mirror of
https://github.com/lektor/lektor-website.git
synced 2025-01-31 14:31:29 +01:00
e52d85abaf
* Updated devDependencies in package.json to their latest versions on NPM * Added "babel-preset-es2015" to compile ES6 to ES5 before passing to UglifyJS, since Uglify can't handle ES6 yet * Suppress warnings from UglifyJS * Ran Webpack to regenerate assets
63 lines
1.3 KiB
JavaScript
63 lines
1.3 KiB
JavaScript
var webpack = require('webpack');
|
|
var path = require('path');
|
|
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
|
|
|
|
|
var options = {
|
|
entry: {
|
|
'app': './js/app.js',
|
|
'styles': './scss/main.scss'
|
|
},
|
|
output: {
|
|
path: path.dirname(__dirname) + '/assets/static',
|
|
filename: '[name].js'
|
|
},
|
|
devtool: '#cheap-module-source-map',
|
|
resolve: {
|
|
modulesDirectories: ['node_modules'],
|
|
extensions: ['', '.js']
|
|
},
|
|
module: {
|
|
loaders: [
|
|
{
|
|
test: /\.js$/,
|
|
exclude: /node_modules/,
|
|
loader: 'babel',
|
|
query: {
|
|
presets: ['es2015'],
|
|
}
|
|
},
|
|
{
|
|
test: /\.scss$/,
|
|
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!sass-loader')
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
|
|
},
|
|
{
|
|
test: /\.(woff2?|ttf|eot|svg|png)(\?.*?)?$/,
|
|
loader: 'file'
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
compress: {
|
|
warnings: false
|
|
}
|
|
}),
|
|
new webpack.optimize.DedupePlugin(),
|
|
new webpack.optimize.OccurenceOrderPlugin(),
|
|
new webpack.ProvidePlugin({
|
|
$: 'jquery',
|
|
jQuery: 'jquery'
|
|
}),
|
|
new ExtractTextPlugin('styles.css', {
|
|
allChunks: true
|
|
})
|
|
]
|
|
};
|
|
|
|
module.exports = options;
|