Skip to content

Instantly share code, notes, and snippets.

@rasjani
Last active August 29, 2015 14:19
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 rasjani/e6b4baf9ff2f5d4c08f3 to your computer and use it in GitHub Desktop.
Save rasjani/e6b4baf9ff2f5d4c08f3 to your computer and use it in GitHub Desktop.
Webpack with canjs
Grunt-webpack to load these:
./config/grunt/webpack.js
./config/webpack.conf.js
Currently using canjs from grunt build:
clone canjs repo
build it:
* npm install
* bower install
* grunt build
* cp -r dist/cjs/* $DEMOREPO/canjs/
*
Dependencies:
"devDependencies": {
"grunt": "0.4.5",
"grunt-cli": "0.1.13",
"grunt-webpack": "1.0.8",
"loader-utils": "0.2.6",
"raw-loader": "0.5.1",
"webpack": "1.6.0",
"webpack-dev-server": "1.7.0"
}
// Webpack configuration
module.exports = {
cache: true,
stats: true,
module: {
loaders: [
{
test: /\.stache$/,
loader: 'raw'
}
]
},
resolve: {
modulesDirectories: [
'src',
'canjs',
'node_modules',
],
extensions: ['', '.js']
}
};
'use strict';
var webpack = require('webpack'),
options = require('../webpack.conf');
module.exports = function () {
return {
options: options,
app: {
context: 'target/',
devtool: 'sourcemap',
entry: {
app: './src/index.js',
vendor: ['canjs','jquery','lodash',]
},
output: {
path: './target',
filename: 'example-app.js',
},
plugins: [
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
]
}
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment