Skip to content

Commit

Permalink
Update webpack.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
xenova committed Aug 7, 2024
1 parent 5a6c926 commit b19251b
Showing 1 changed file with 45 additions and 34 deletions.
79 changes: 45 additions & 34 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,40 +29,51 @@ function buildConfig({
}),
);

return {
mode: 'development',
devtool: 'source-map',
entry: {
[`transformers${name}`]: './src/transformers.js',
[`transformers${name}.min`]: './src/transformers.js',
},
output: {
filename: `[name]${suffix}`,
path: path.join(__dirname, 'dist'),
library: {
type,
},
assetModuleFilename: '[name][ext]',
chunkFormat: 'module',
},
module: {
parser: {
javascript: {
importMeta: false
}
}
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin({
test: new RegExp(`\\.min\\${suffix}$`),
extractComments: false,
})],
},
experiments: {
outputModule,
},
resolve: { alias },
return {
mode: 'development',
devtool: 'source-map',
entry: {
[`transformers${name}`]: './src/transformers.js',
[`transformers${name}.min`]: './src/transformers.js',
},
output: {
filename: `[name]${suffix}`,
path: path.join(__dirname, 'dist'),
library: {
type,
},
assetModuleFilename: '[name][ext]',
chunkFormat: 'module',
},
plugins: [
// Copy .wasm files to dist folder
new CopyWebpackPlugin({
patterns: [
{
from: "node_modules/onnxruntime-web/dist/*.wasm",
to: "dist/[name][ext]",
},
],
}),
],
module: {
parser: {
javascript: {
importMeta: false
}
}
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin({
test: new RegExp(`\\.min\\${suffix}$`),
extractComments: false,
})],
},
experiments: {
outputModule,
},
resolve: { alias },

// Development server
devServer: {
Expand Down

0 comments on commit b19251b

Please sign in to comment.