Skip to content

Commit

Permalink
add webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
zkeyword committed Dec 7, 2015
1 parent 9c87f16 commit f25f096
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
'use strict';

var path = require('path');
var webpack = require('webpack');

module.exports = {
entry: [
'./dev/js/main.js'
],
resolve: {
modulesDirectories: [
'node_modules',
'lib'
],
alias: {
jquery: "jquery1.10.2.js"
}
},
externals: {
jquery: 'jQuery' //引用外部cdn时,可排除外部的代码
},
output: {
path: __dirname + "/dest/js/",
filename: "main.js"
},
module: {
loaders: [
/*{
test: /\.js$/,
exclude: /node_modules/,
loader: 'jscrambler-loader'
}*/
]
},
plugins: [
/*
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
'root.jQuery': 'jquery'
})
*/
]
};

0 comments on commit f25f096

Please sign in to comment.