Skip to content

Commit 4badd58

Browse files
committed
Forsøker webpack5 med next-with-less
1 parent 4fc79e5 commit 4badd58

File tree

6 files changed

+1890
-6962
lines changed

6 files changed

+1890
-6962
lines changed

next-env.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/// <reference types="next" />
2-
/// <reference types="next/types/global" />
32
/// <reference types="next/image-types/global" />
43

54
// NOTE: This file should not be edited

next.config.js

+29-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const withPlugins = require('next-compose-plugins');
2-
const withLess = require('@zeit/next-less');
32
const withImages = require('next-images');
3+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
4+
const withLess = require('next-with-less');
45
const packageJson = require('./package.json');
56

67
const navFrontendModuler = Object.keys(packageJson.dependencies).reduce(
@@ -15,8 +16,7 @@ const withTranspileModules = require('next-transpile-modules')([
1516
'@navikt/ds-icons',
1617
]);
1718

18-
module.exports = withPlugins([withTranspileModules, withLess, withImages], {
19-
webpack5: false,
19+
module.exports = withPlugins([withLess, withImages, withTranspileModules], {
2020
assetPrefix: process.env.APP_ORIGIN,
2121
env: {
2222
ENV: process.env.ENV,
@@ -95,4 +95,30 @@ module.exports = withPlugins([withTranspileModules, withLess, withImages], {
9595
],
9696
},
9797
],
98+
// webpack: (config) => {
99+
// config.module.rules.push({
100+
// test: /\.(le|c)ss$/,
101+
// use: [
102+
// MiniCssExtractPlugin.loader,
103+
// {
104+
// loader: 'css-loader',
105+
// },
106+
// {
107+
// loader: 'less-loader',
108+
// options: {
109+
// sourceMap: true,
110+
// },
111+
// },
112+
// ],
113+
// });
114+
//
115+
// config.plugins.push(
116+
// new MiniCssExtractPlugin({
117+
// filename: 'static/css/[name].css',
118+
// chunkFilename: 'static/css/[contenthash].css',
119+
// })
120+
// );
121+
//
122+
// return config;
123+
// },
98124
});

0 commit comments

Comments
 (0)