Skip to content

Instantly share code, notes, and snippets.

@lipelopeslage
Created April 2, 2016 01:04
Show Gist options
  • Save lipelopeslage/9ac754eea00060b8b048d2fb56a1a1a0 to your computer and use it in GitHub Desktop.
Save lipelopeslage/9ac754eea00060b8b048d2fb56a1a1a0 to your computer and use it in GitHub Desktop.
Webpack Config
var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: {
main: './js/main.js',
ignore: ['./stylus/style.styl']
},
output: {
path: '../build/js',
filename: 'bundle.js'
},
resolve: {
modulesDirectories: ["js", "components", "node_modules"],
root: path.resolve(__dirname),//parece não ser necessário
extensions: ['','.js', '.css'],//parece não ser necessário
alias:{
highlights: './components/highlights.js',
navigation: './../ui/navigation.js'
}
},
module: {
loaders: [
{ test: /\.styl$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader!stylus-loader")
},
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{ test: /\.(png|jpg)$/, loader: 'url-loader' },
{
test: /\.js$/,
exclude: /node_modules|stylus|style.styl/,
loader: 'babel',
query:{
presets: ['react']
}
}
]
},
plugins: [
new ExtractTextPlugin("../css/style.css",{
allChunks: true
})
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment