diff options
author | Yukai Huang | 2016-11-02 18:01:26 +0800 |
---|---|---|
committer | Yukai Huang | 2016-11-02 18:01:26 +0800 |
commit | f1f8846b0adc6dd330286d2edeb399215530a391 (patch) | |
tree | 5f0bc5672978798f921a6edf01ac5bba7e1f8574 /webpack.production.js | |
parent | 3e23009663d72526f393348f91e45fde93f67236 (diff) |
Config extra entry for html.min.css
Diffstat (limited to 'webpack.production.js')
-rw-r--r-- | webpack.production.js | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/webpack.production.js b/webpack.production.js index 1a55e615..a4dfd248 100644 --- a/webpack.production.js +++ b/webpack.production.js @@ -3,7 +3,7 @@ var webpack = require('webpack'); var path = require('path'); var ExtractTextPlugin = require("extract-text-webpack-plugin"); -module.exports = Object.assign({}, baseConfig, { +module.exports = [Object.assign({}, baseConfig, { plugins: baseConfig.plugins.concat([ new webpack.DefinePlugin({ 'process.env': { @@ -25,4 +25,33 @@ module.exports = Object.assign({}, baseConfig, { publicPath: '/build/', filename: '[id].[name].[hash].js' } -}); +}), { + entry: { + htmlExport: path.join(__dirname, 'public/js/htmlExport.js') + }, + module: { + loaders: [{ + test: /\.css$/, + loader: ExtractTextPlugin.extract('style-loader', 'css-loader') + }, { + test: /\.scss$/, + loader: ExtractTextPlugin.extract('style-loader', 'sass-loader') + }, { + test: /\.less$/, + loader: ExtractTextPlugin.extract('style-loader', 'less-loader') + }] + }, + output: { + path: path.join(__dirname, 'public/build'), + publicPath: '/build/', + filename: '[name].js' + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': { + 'NODE_ENV': JSON.stringify('production') + } + }), + new ExtractTextPlugin("html.min.css") + ] +}]; |