Skip to content

Instantly share code, notes, and snippets.

@aclave1
Last active August 29, 2015 14:19
Show Gist options
  • Save aclave1/388c78f7c0b32810a372 to your computer and use it in GitHub Desktop.
Save aclave1/388c78f7c0b32810a372 to your computer and use it in GitHub Desktop.
A reference webpack config.
var webpack = require('webpack');
var path = require('path');
module.exports = {
context: __dirname + '/assets/js',
//the file to build
entry: './main.js',
output: {
path: __dirname + '/assets/js',
filename: 'bundle.js'
},
resolve: {
alias: {
//file path aliases
"angular": "vendor/angular/angular.min.js",
},
root: ['assets/js','node_modules'],
extensions: ['', '.webpack.js', '.web.js', '.ts', '.js'],
modulesDirectories:['node_modules']
},
resolveLoader:{
root: [path.join(__dirname,"node_modules")]
},
plugins: [
],
module: {
loaders: [
{test: /\.html$/, loader: "html"},
//{test:/\.ts$/,loader:'typescript-loader'}
],
noParse: [
//path to files not to parse, good for prebuilt libs
]
}
};
//a simple grunt webpack config
module.exports = function (grunt) {
grunt.config.set('webpack', {
options: require('../../webpack.config'),
dev: {
progress: true
}
});
grunt.loadNpmTasks('grunt-webpack');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment