-
-
Save Walkeryr/44783b973b6b6a27980e to your computer and use it in GitHub Desktop.
This file contains 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
var path = require('path'); | |
var webpack = require('webpack'); | |
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
var autoprefixer = require('autoprefixer'); | |
var csswring = require('csswring'); | |
var postcssNested = require('postcss-nested'); | |
var cssvariables = require('postcss-css-variables'); | |
var postcssPosition = require('postcss-position'); | |
var BrowserSyncPlugin = require('browser-sync-webpack-plugin'); | |
module.exports = { | |
output: { | |
path: path.join(__dirname, 'static'), | |
publicPath: 'static/', | |
filename: '[name].js', | |
chunkFilename: '[chunkhash].js' | |
}, | |
resolve: { | |
root: [path.join(__dirname, 'node_modules')] | |
}, | |
plugins: [ | |
new webpack.optimize.DedupePlugin(), | |
new webpack.ProvidePlugin({ | |
$: 'jquery' | |
}), | |
new webpack.ResolverPlugin( | |
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('bower.json', ['main']) | |
), | |
new ExtractTextPlugin('[name].css'), | |
new webpack.optimize.CommonsChunkPlugin('libs.js', ['app', 'libs']), | |
new BrowserSyncPlugin({ | |
proxy: 'localhost:8000', | |
files: 'static/js/front/**/*.css' | |
}, { | |
reload: false | |
}) | |
], | |
module: { | |
loaders: [ | |
{ | |
test: /\.js$/, | |
exclude: /(node_modules)/, | |
loader: 'babel' | |
}, | |
{ | |
test: /\.css$/, | |
loader: ExtractTextPlugin.extract('css-loader!postcss-loader') | |
}, | |
{ | |
test: /\.(nunj|nunjucks|jinja|svg)$/, | |
loader: 'nunjucks-loader' | |
} | |
] | |
}, | |
postcss: [postcssPosition, postcssNested, cssvariables, autoprefixer({browsers: ['last 2 versions', 'ie 10']}), csswring], | |
externals: { | |
jquery: 'jQuery' | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment