把它放在你的 webpack 配置中。主要来自基础
var path = require("path")
var webpack = require('webpack')
module.exports = {
context: __dirname,
entry: {
// Add as many entry points as you have container-react-components here
App: './reactjs/App',
vendors: ['react'],
},
output: {
path: path.resolve('./example/static/bundles/local/'),
filename: "[name]-[hash].js"
},
externals: [
], // add all vendor libs
plugins: [
new webpack.optimize.CommonsChunkPlugin({ name: 'vendors', filename: 'vendors.bundle.js', minChunks: Infinity }),
], // add all common plugins here
module: {
loaders: [] // add all common loaders here
},
resolve: {
alias: {
react: path.resolve('./node_modules/react'),
lodash: path.resolve('./node_modules/lodash')
}
},
}
干杯....