-
Notifications
You must be signed in to change notification settings - Fork 23
/
webpack.headless.js
43 lines (38 loc) · 978 Bytes
/
webpack.headless.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
36
37
38
39
40
41
42
43
const path = require('path');
const webpack = require('webpack');
const baseConfig = require('./webpack.base');
const ASSET_PATH = process.env.ASSET_PATH || 'https://ameo.dev/web-synth-headless/';
/**
* @type {import('webpack').Configuration}
*/
const config = {
...baseConfig,
entry: {
headless: {
import: './src/headless/index.tsx',
library: {
// name: 'web-synth-headless',
type: 'module',
},
},
},
output: {
path: path.resolve(__dirname, 'dist/headless'),
// filename: '[name].[contenthash].js',
filename: '[name].js',
publicPath: ASSET_PATH,
library: {
// name: 'web-synth-headless',
type: 'module',
},
libraryTarget: 'module',
},
plugins: [...baseConfig.plugins, new webpack.EnvironmentPlugin({ ASSET_PATH })],
mode: 'production',
devtool: 'source-map',
experiments: {
...(baseConfig.experiments || {}),
outputModule: true,
},
};
module.exports = config;