Skip to content

Instantly share code, notes, and snippets.

@Szeliga
Created February 25, 2015 12:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Szeliga/3d4ce2925c89a7fbcc59 to your computer and use it in GitHub Desktop.
Save Szeliga/3d4ce2925c89a7fbcc59 to your computer and use it in GitHub Desktop.
Webpack config
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