Saya sedang membaca tutorial webpack ini:
https://webpack.github.io/docs/usage.html
Dikatakan itu menggabungkan file src dan node_modules. Jika saya ingin menambahkan file .js lain di sana, bagaimana caranya? Ini adalah file pihak ketiga yang bukan bagian dari sumber dan bukan bagian dari file node_modules. Ini adalah webpack.config.js saya saat ini:
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: [
'react-hot-loader/patch',
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
'./app/app.js'
],
output: {
path: path.resolve(__dirname, "dist"),
publicPath: "/dist/",
filename: "dist.js",
sourceMapFilename: "dist.map"
},
devtool: 'source-map',
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('development')
}
}),
],
module: {
loaders: [{
loader: 'babel',
exclude: /node_modules/
}]
},
devServer: {
inline: true
},
node: {
fs: "empty"
},
watch: false
}