working v1.
This commit is contained in:
42
build.js
42
build.js
@@ -4,22 +4,26 @@ const esbuild = require('esbuild')
|
||||
const alias = require('esbuild-plugin-alias')
|
||||
const nodeGlobals = require('@esbuild-plugins/node-globals-polyfill').default
|
||||
|
||||
esbuild.build({
|
||||
bundle: true,
|
||||
entryPoints: {
|
||||
'options.build': './extension/options.js',
|
||||
'content-script.build': './extension/content-script.js',
|
||||
'background.build': './extension/background.js'
|
||||
},
|
||||
outdir: './extension',
|
||||
plugins: [
|
||||
alias({
|
||||
stream: require.resolve('readable-stream')
|
||||
}),
|
||||
nodeGlobals()
|
||||
],
|
||||
sourcemap: 'inline',
|
||||
define: {
|
||||
global: 'window'
|
||||
}
|
||||
})
|
||||
esbuild
|
||||
.build({
|
||||
bundle: true,
|
||||
entryPoints: {
|
||||
'popup.build': './extension/popup.jsx',
|
||||
'prompt.build': './extension/prompt.jsx',
|
||||
'options.build': './extension/options.jsx',
|
||||
'background.build': './extension/background.js',
|
||||
'content-script.build': './extension/content-script.js'
|
||||
},
|
||||
outdir: './extension',
|
||||
plugins: [
|
||||
alias({
|
||||
stream: require.resolve('readable-stream')
|
||||
}),
|
||||
nodeGlobals()
|
||||
],
|
||||
sourcemap: 'inline',
|
||||
define: {
|
||||
global: 'window'
|
||||
}
|
||||
})
|
||||
.then(() => console.log('build success.'))
|
||||
|
||||
Reference in New Issue
Block a user