Skip to content

Instantly share code, notes, and snippets.

@kyleshevlin
Forked from wesbos/wespack.js
Last active Feb 7, 2017
Embed
What would you like to do?
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