Last active
August 29, 2015 14:19
-
-
Save rasjani/e6b4baf9ff2f5d4c08f3 to your computer and use it in GitHub Desktop.
Webpack with canjs
This file contains 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
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" | |
} |
This file contains 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
// Webpack configuration | |
module.exports = { | |
cache: true, | |
stats: true, | |
module: { | |
loaders: [ | |
{ | |
test: /\.stache$/, | |
loader: 'raw' | |
} | |
] | |
}, | |
resolve: { | |
modulesDirectories: [ | |
'src', | |
'canjs', | |
'node_modules', | |
], | |
extensions: ['', '.js'] | |
} | |
}; |
This file contains 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
'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