-
Notifications
You must be signed in to change notification settings - Fork 6
/
webpack.config.js
35 lines (34 loc) · 1.06 KB
/
webpack.config.js
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
const defaultConfig = require('@wordpress/scripts/config/webpack.config');
const DependencyExtractionWebpackPlugin = require('@woocommerce/dependency-extraction-webpack-plugin');
const {resolve} = require('path');
module.exports = () => {
return {
...defaultConfig,
output: {
filename: '[name].js',
path: resolve(process.cwd(), 'assets/build'),
},
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'ts-loader',
},
...defaultConfig.module.rules,
],
},
plugins: [
...defaultConfig.plugins.filter(
(plugin) => plugin.constructor.name !== 'DependencyExtractionWebpackPlugin',
),
new DependencyExtractionWebpackPlugin(),
],
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
entry: {
blocks: './client/blocks/index.js',
},
};
};