forked from wpengine/phpcompat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
29 lines (28 loc) · 833 Bytes
/
Copy pathwebpack.config.js
File metadata and controls
29 lines (28 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const { merge } = require("webpack-merge");
const defaultConfig = require("@wordpress/scripts/config/webpack.config");
const DependencyExtractionWebpackPlugin = require("@wordpress/dependency-extraction-webpack-plugin");
const path = require("path");
const webpack = require('webpack');
module.exports = merge(defaultConfig, {
output: {
path: path.resolve(process.cwd(), "plugin/build"),
},
entry: {
scan: path.resolve(process.cwd(), "src/js", "scan.js"),
},
plugins: [
...defaultConfig.plugins.filter(
(plugin) =>
plugin.constructor.name !== "DependencyExtractionWebpackPlugin"
),
new DependencyExtractionWebpackPlugin(),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
],
resolve: {
fallback: {
buffer: require.resolve("buffer/"),
}
}
});