Skip to content

Instantly share code, notes, and snippets.

@kyleshevlin
Forked from wesbos/wespack.js
Last active February 7, 2017 21:35
Show Gist options
  • Save kyleshevlin/c155b001266e31c56288e73f370351ea to your computer and use it in GitHub Desktop.
Save kyleshevlin/c155b001266e31c56288e73f370351ea to your computer and use it in GitHub Desktop.
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const javascript = {
test: /\.(js)$/,
use: [{
loader: 'babel-loader',
options: { presets: ['es2015'] }
}],
};
const styles = {
test: /\.(scss)$/,
use: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: 'css-loader?sourceMap!sass-loader?sourceMap'
})
};
const uglify = new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false }
});
const config = {
entry: {
App: './public/javascripts/delicious-app.js'
},
devtool: 'source-map',
output: {
path: path.resolve(__dirname, 'public', 'javascripts', 'dist'),
filename: '[name].bundle.js'
},
module: {
rules: [javascript, styles]
},
plugins: [
new ExtractTextPlugin('please-just-make-this-a-file.css'),
]
};
module.exports = config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment