猿问

为什么CSS单独打包的时候生成不了文件夹~??? webpack是成功的

var webpack = require('webpack');

var ExtractTextPlugin = require('extract-text-webpack-plugin');


var config = {

entry: {

'common': ['./src/page/common/index.js'],

'index' : ['./src/page/index/index.js'],

'login' : ['./src/page/login/login.js']

},

output: {

path: __dirname + '/dist',

filename: 'js/[name].js'

},

externals : {

'jquery' : 'window.jQuery'

},

module: {

loaders: [

{ test: /\.css$/,loader: ExtractTextPlugin.extract("style-loader!css-loader") }

]

},

plugins: [

new webpack.optimize.CommonsChunkPlugin({

name : 'common',

filename : 'js/base.js',

// minChunks: Infinity

}),

new ExtractTextPlugin("dist/css/[name].css"),

]

};

module.exports = config;


毛Bing
浏览 896回答 0
0回答
随时随地看视频慕课网APP
我要回答