Javascript 从网页包包中排除特定文件
在我的React应用程序中,我正在使用Webpack。这是我的webpack.config:Javascript 从网页包包中排除特定文件,javascript,reactjs,webpack,bundle,Javascript,Reactjs,Webpack,Bundle,在我的React应用程序中,我正在使用Webpack。这是我的webpack.config: "use strict"; var path = require("path"); var WebpackNotifierPlugin = require("webpack-notifier"); var BrowserSyncPlugin = require("browser-sync-webpack-plugin"); module.exports = { entry: "./Scrip
"use strict";
var path = require("path");
var WebpackNotifierPlugin = require("webpack-notifier");
var BrowserSyncPlugin = require("browser-sync-webpack-plugin");
module.exports = {
entry: "./Scripts/reactApp/index.jsx",
output: {
path: path.resolve(__dirname, "./Scripts/reactApp/build"),
filename: "react_bundle.js"
},
module: {
rules: [
{
test: /\.jsx$/,
exclude: [/node_modules/, path.resolve(__dirname, "./Scripts/reactApp/translations/he.translations.json")],
use: {
loader: "babel-loader"
}
},
{
test: /\.js$/,
exclude: [/node_modules/, path.resolve(__dirname, "./Scripts/reactApp/translations/he.translations.json")],
use: {
loader: "babel-loader"
}
}
]
},
devtool: "inline-source-map",
plugins: [new WebpackNotifierPlugin(), new BrowserSyncPlugin()]
};
我试图从bundlehe.translations.json中排除
但这个网页包含了它
你能解释一下我做错了什么吗?
对不起,我是新来的。你可以(从)开始
路径中没有点,当然,假设您将wepback配置文件放在正确的位置。您只需执行(从)
路径中没有点,当然,假设您在正确的位置有wepback配置文件
...
exclude: [/node_modules/, path.resolve(__dirname, 'Scripts/reactApp/translations/he.translations.json')],
...