Skip to content

Commit 0a3e6b9

Browse files
committed
Fix the extrace error
1 parent 2546398 commit 0a3e6b9

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

app/templates/_webpack.config.js

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,6 @@ module.exports = {
4040
test: /\.html$/,
4141
loader: 'vue-html'
4242
},
43-
{
44-
test: /\.css$/,
45-
loader: ExtractTextPlugin.extract('style!css')
46-
},
47-
{
48-
test: /\.less$/,
49-
loader: ExtractTextPlugin.extract('style!css!less')
50-
},
5143
{
5244
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
5345
loader: 'url',
@@ -73,6 +65,17 @@ if (process.env.NODE_ENV === 'production') {
7365
module.exports.output.filename = 'static/js/[name]_[chunkhash].js';
7466
module.exports.output.chunkFilename = "static/js/[id]_[chunkhash].js";
7567

68+
module.exports.module.loaders = module.exports.module.loaders.concat([
69+
{
70+
test: /\.css$/,
71+
loader: ExtractTextPlugin.extract('style','css')
72+
},
73+
{
74+
test: /\.less$/,
75+
loader: ExtractTextPlugin.extract('style', 'css', 'less')
76+
}
77+
]);
78+
7679
module.exports.plugins = [
7780
new webpack.DefinePlugin({
7881
'process.env': {
@@ -109,6 +112,17 @@ if (process.env.NODE_ENV === 'production') {
109112
// development configurations
110113
module.exports.output.filename = 'static/js/[name].js';
111114

115+
module.exports.module.loaders = module.exports.module.loaders.concat([
116+
{
117+
test: /\.css$/,
118+
loader: 'style!css'
119+
},
120+
{
121+
test: /\.less$/,
122+
loader: 'style!css!less'
123+
}
124+
]);
125+
112126
module.exports.plugins = [
113127
new HtmlWepackPlugin({
114128
filename: 'index.html',

0 commit comments

Comments
 (0)