我想从webpack的 entry 或 output 目录之外复制一个文件 . 我需要一个与bundle完全分离的属性文件 .
所以我有这个结构:
/project
/config
properties.js
/dist
bundle.js
webpack-created-index.html
/src
index.html-with-custom-script-tag
...source files and folder here
我想让我的webpack.config复制源代码控制的配置文件夹(没有摆弄它的内容)所以我的dist文件夹看起来像这样:
/dist
/config
properties.js
bundle.js
webpack-created-index.html
我希望能够让我的webpack创建的index.html加载那个properties.js文件,如下所示:
我的浏览器显示404,即使我将
我的webpack.config.js入口/输出如下:
config.entry = {
app: './src/app.js'
};
config.output = {
path: __dirname + '/dist',
publicPath: 'http://localhost:8080/',
filename: '[name].bundle.js'
};
是否可以使用webpack执行此操作,或者我是否需要引入gulp或节点脚本等内容来执行此操作?我的 strong preference 将使用webpack实现这一点,而不必使用外部脚本或库使构建复杂化 .