Created
February 7, 2017 21:25
-
-
Save wesbos/54e32dab4dd3e7d86893c91f4b29139c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(['style-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
@wesbos you can use style-loader as fallback loader, if you need.I worked on one webpack setup few days ago and this is how I did it: