Skip to content

Instantly share code, notes, and snippets.

@woshi82
Created December 8, 2016 02:45
Show Gist options
  • Save woshi82/a0b3a7fe4ccdbb695942eb64d1cc8f1e to your computer and use it in GitHub Desktop.
Save woshi82/a0b3a7fe4ccdbb695942eb64d1cc8f1e to your computer and use it in GitHub Desktop.
/*
* Webpack distribution configuration
*
* This file is set up for serving the distribution version. It will be compiled to dist/ by default
*/
'use strict';
var webpack = require('webpack');
module.exports = {
output: {
publicPath: '/assets/',
path: 'dist/assets/',
filename: 'main.js'
},
debug: false,
devtool: false,
entry: './src/components/GalleryByReactApp.js',
stats: {
colors: true,
reasons: false
},
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.AggressiveMergingPlugin(),
new webpack.NoErrorsPlugin()
],
resolve: {
extensions: ['', '.js', '.jsx'],
alias: {
'styles': __dirname + '/src/styles',
'mixins': __dirname + '/src/mixins',
'components': __dirname + '/src/components/'
}
},
module: {
preLoaders: [{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'eslint-loader'
}],
loaders: [{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel-loader'
}, {
test: /\.css$/,
loader: 'style-loader!css-loader!autoprefixer-loader?{browsers:["last 2 version", "firefox 15"]}'
}, {
test: /\.scss/,
loader: 'style-loader!css-loader!autoprefixer-loader?{browsers:["last 2 version", "firefox 15"]}!sass-loader?outputStyle=expanded'
}, {
test: /\.json$/,
loader: 'json-loader'
}, {
test: /\.(png|jpg|woff|woff2|eot|ttf|svg)$/,
loader: 'url-loader?limit=8192'
}]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment