-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
33 lines (31 loc) · 896 Bytes
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const webpack = require("webpack")
module.exports = {
webpack: function (webpackConfig, { dev }) {
webpackConfig.resolve.extensions = ['.css', '.js', '.jsx', '.json'];
let cssLoader = {
test: /\.css$/,
loader: ExtractTextPlugin.extract({
loader: `${require.resolve('css-loader')}`
})
};
webpackConfig.module.rules.unshift(cssLoader);
webpackConfig.plugins.push(
new ExtractTextPlugin({
filename: '../static/[name].css',
disable: false,
allChunks: true
}),
new CopyWebpackPlugin([{
from: {
glob: `./pages/**/*.css`,
dot: true
},
to: `./dist/[path]/[name].css`
}], { debug: 'warning' }
)
)
return webpackConfig
}
}