1
1
const withPlugins = require ( 'next-compose-plugins' ) ;
2
- const withLess = require ( '@zeit/next-less' ) ;
3
2
const withImages = require ( 'next-images' ) ;
3
+ const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' ) ;
4
+ const withLess = require ( 'next-with-less' ) ;
4
5
const packageJson = require ( './package.json' ) ;
5
6
6
7
const navFrontendModuler = Object . keys ( packageJson . dependencies ) . reduce (
@@ -15,8 +16,7 @@ const withTranspileModules = require('next-transpile-modules')([
15
16
'@navikt/ds-icons' ,
16
17
] ) ;
17
18
18
- module . exports = withPlugins ( [ withTranspileModules , withLess , withImages ] , {
19
- webpack5 : false ,
19
+ module . exports = withPlugins ( [ withLess , withImages , withTranspileModules ] , {
20
20
assetPrefix : process . env . APP_ORIGIN ,
21
21
env : {
22
22
ENV : process . env . ENV ,
@@ -95,4 +95,30 @@ module.exports = withPlugins([withTranspileModules, withLess, withImages], {
95
95
] ,
96
96
} ,
97
97
] ,
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
+ // },
98
124
} ) ;
0 commit comments