2021-12-06 16:25:19 +00:00
|
|
|
import esbuild from 'esbuild'
|
2024-06-13 10:41:40 +00:00
|
|
|
import { sassPlugin } from 'esbuild-sass-plugin'
|
|
|
|
import vuePlugin from 'esbuild-plugin-vue3'
|
2021-12-06 16:25:19 +00:00
|
|
|
|
2024-06-13 10:41:40 +00:00
|
|
|
const buildOpts = {
|
|
|
|
assetNames: '[name]-[hash]',
|
2021-12-06 16:25:19 +00:00
|
|
|
bundle: true,
|
|
|
|
define: {
|
|
|
|
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'dev'),
|
|
|
|
},
|
2024-06-13 10:41:40 +00:00
|
|
|
entryPoints: ['src/main.ts'],
|
|
|
|
legalComments: 'none',
|
|
|
|
loader: {
|
2024-06-16 14:23:46 +00:00
|
|
|
'.md': 'text',
|
2024-06-13 10:41:40 +00:00
|
|
|
'.ttf': 'file',
|
|
|
|
'.woff2': 'file',
|
|
|
|
},
|
2021-12-06 16:25:19 +00:00
|
|
|
minify: true,
|
|
|
|
outfile: 'editor/app.js',
|
2024-06-13 10:41:40 +00:00
|
|
|
plugins: [
|
|
|
|
sassPlugin(),
|
|
|
|
vuePlugin(),
|
|
|
|
],
|
2021-12-06 16:25:19 +00:00
|
|
|
target: [
|
2024-06-13 10:41:40 +00:00
|
|
|
'chrome109',
|
|
|
|
'edge116',
|
2021-12-06 16:25:19 +00:00
|
|
|
'es2020',
|
2024-06-13 10:41:40 +00:00
|
|
|
'firefox115',
|
|
|
|
'safari15',
|
2021-12-06 16:25:19 +00:00
|
|
|
],
|
2024-06-13 10:41:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export { buildOpts }
|
|
|
|
|
|
|
|
esbuild.build(buildOpts)
|