forked from Automattic/jetpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.search.js
More file actions
39 lines (35 loc) · 1.08 KB
/
Copy pathwebpack.config.search.js
File metadata and controls
39 lines (35 loc) · 1.08 KB
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
30
31
32
33
34
35
36
37
38
39
/**
* External dependencies
*/
const getBaseWebpackConfig = require( '@automattic/calypso-build/webpack.config.js' );
const DependencyExtractionWebpackPlugin = require( '@wordpress/dependency-extraction-webpack-plugin' );
const path = require( 'path' );
const isDevelopment = process.env.NODE_ENV !== 'production';
const baseWebpackConfig = getBaseWebpackConfig(
{ WP: false },
{
entry: { search: path.join( __dirname, './modules/search/instant-search/index.jsx' ) },
'output-chunk-filename': 'jp-search.chunk-[name]-[hash].js',
'output-filename': 'jp-search.bundle.js',
'output-path': path.join( __dirname, '_inc', 'build', 'instant-search' ),
}
);
const sharedWebpackConfig = {
...baseWebpackConfig,
resolve: {
...baseWebpackConfig.resolve,
modules: [ path.resolve( __dirname, '_inc/client' ), 'node_modules' ],
},
node: {
fs: 'empty',
process: true,
},
devtool: isDevelopment ? 'source-map' : false,
};
module.exports = {
...sharedWebpackConfig,
plugins: [
...sharedWebpackConfig.plugins,
new DependencyExtractionWebpackPlugin( { injectPolyfill: true } ),
],
};