Created
February 25, 2015 12:24
-
-
Save Szeliga/3d4ce2925c89a7fbcc59 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 webpack = require('webpack'); | |
var path = require('path'); | |
var node_modules_dir = __dirname + '/node_modules'; | |
var node_env = process.env.NODE_ENV; | |
var config = { | |
addVendor: function(name, path) { | |
this.resolve.alias[name] = path; | |
}, | |
addPlugin: function(plugin) { | |
this.plugins.push(plugin); | |
}, | |
watch: true, | |
entry: { | |
app: ['webpack/hot/dev-server', __dirname + '/app/app.js'] | |
}, | |
output: { | |
path: node_env === 'production' ? './dist' : './build', | |
filename: 'bundle.js' | |
}, | |
plugins: [], | |
module: { | |
noParse: [], | |
loaders: [ | |
{ test: /\.jade$/, loader: "ng-cache!jade-html" }, | |
{ test: /\.css$/, loader: 'style!css' }, | |
{ test: /\.sass$/, loader: "style!css!sass?indentedSyntax=sass&" + | |
"includePaths[]=" + (path.resolve(__dirname, "./node_modules")) }, | |
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' }, | |
{ test: /\.jpe?g$|\.gif$|\.png$|\.svg$|\.woff$|\.woff2$|\.ttf$|\.eot$|\.wav$|\.mp3$/, loader: "file" } | |
] | |
}, | |
resolve: { | |
extensions: ['', '.js', '.json', '.css', '.sass', '.scss'], | |
alias: { | |
stylesheets: __dirname + "/assets/stylesheets", | |
} | |
} | |
}; | |
config.addVendor('angular-material.css', 'angular-material/angular-material.css'); | |
module.exports = config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment