Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import webpack from 'webpack';
- import path from 'path';
- import ExtractTextPlugin from 'extract-text-webpack-plugin';
- const GLOBALS = {
- 'process.env.NODE_ENV': JSON.stringify('production')
- };
- export default {
- debug: true,
- devtool: 'source-map',
- noInfo: false,
- entry: './src/index',
- target: 'web',
- output: {
- path: __dirname + '/dist', // Note: Physical files are only output by the production build task `npm run build`.
- publicPath: '/',
- filename: 'bundle.js'
- },
- devServer: {
- contentBase: './dist'
- },
- plugins: [
- new webpack.optimize.OccurenceOrderPlugin(),
- new webpack.DefinePlugin(GLOBALS),
- new webpack.optimize.DedupePlugin(),
- new ExtractTextPlugin('styles.css', {
- allChunks: true
- }),
- new webpack.optimize.UglifyJsPlugin()
- ],
- module: {
- loaders: [
- {test: /\.js$/, include: path.join(__dirname, 'src'), loaders: ['babel']},
- {test: /(\.css)$/,
- loader: ExtractTextPlugin.extract("style-loader", "css-loader"),
- include: [path.join(__dirname, 'node_modules'), path.join(__dirname, 'src/static') ]
- },
- {test: /(\.css)$/,
- loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader'),
- exclude: [path.join(__dirname, 'node_modules'), path.join(__dirname, 'src/static') ]
- },
- {test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file"},
- {test: /\.(woff|woff2)$/, loader: "url?prefix=font/&limit=5000"},
- {test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream"},
- {test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml"}
- ]
- },
- postcss: [
- require('autoprefixer'),
- require('postcss-color-rebeccapurple')
- ]
- };
Add Comment
Please, Sign In to add comment