- var webpack = require('webpack');
- var commonsPlugin = webpack.optimize.CommonsChunkPlugin;
- module.exports = {
- entry: {
- index: '. / index.js'
- },
- output: {
- path: path.resolve(__dirname, '. / dist'),
- filename: 'build. [name].js'
- },
- module: {
- loaders: [{
- test: /\.CSS$/,
- loader: 'style - loader ! css - loader'
- },
- {
- test: /\.js$/,
- loader: 'jsx - loader ? harmony'
- },
- {
- test: /\.scss$/,
- loader: 'style ! css ! sass ? sourceMap'
- },
- {
- test: /\.(png|jpg)$/,
- loader: 'url - loader ? limit = 8192'
- }]
- },
- plugins: [new commonsPlugin("commons.js")]
- };
来源: