Created
April 2, 2016 01:04
-
-
Save lipelopeslage/9ac754eea00060b8b048d2fb56a1a1a0 to your computer and use it in GitHub Desktop.
Webpack Config
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
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