Skip to content

Instantly share code, notes, and snippets.

@violetlight
Created May 4, 2016 02:48
Show Gist options
  • Save violetlight/b050b021b8b426a11cd283afd0189e85 to your computer and use it in GitHub Desktop.
Save violetlight/b050b021b8b426a11cd283afd0189e85 to your computer and use it in GitHub Desktop.
Barebones webpack config
var config, path, webpack;
path = require('path');
webpack = require('webpack');
config = {
context: path.resolve(__dirname, 'src'),
entry : {
app: './app.js'
},
output: {
path: __dirname + '/dist/js',
filename: '[name].js',
publicPath: '/js/'
},
module: {
loaders: [
{
test: /\.html$/,
loader: 'html-loader',
}, {
test: /\.css$/,
loader: 'style!css',
}, {
test: /\.less$/,
loader: 'style!css!less',
}, {
test: /\.sass$/,
loader: 'style!css!sass?indentedSyntax',
}, {
test: /\.(woff(2)?|ttf|eot|svg|png|cur|jpg|gif)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'file'
}
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({mangle: false})
]
};
module.exports = config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment