Add webpack for external frontend libraries.

This commit is contained in:
Cohee
2024-10-16 22:00:14 +03:00
parent 725cfdebca
commit 4725b869eb
6 changed files with 968 additions and 12 deletions

20
webpack.config.js Normal file
View File

@ -0,0 +1,20 @@
/** @type {import('webpack').Configuration} */
export const publicLibConfig = {
mode: 'production',
entry: './public/lib.js',
cache: true,
devtool: 'source-map',
module: {
rules: [{
test: /\.js$/,
exclude: /node_modules/,
}],
},
experiments: {
outputModule: true,
},
output: {
filename: 'lib.js',
libraryTarget: 'module',
},
};