Skip to content

Commit

Permalink
build: copy more static files
Browse files Browse the repository at this point in the history
  • Loading branch information
cnblogs-dudu committed Dec 12, 2023
1 parent 4eb2ada commit 13cb44a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,31 @@ import * as process from 'node:process'

const { copyPlugin } = copyPluginPkg
const isProduction = process.argv.includes('--production')
const OUT_DIR = 'dist'

/** @type {esbuild.BuildOptions} */
const options = {
entryPoints: ['./src/extension.ts'],
bundle: true,
outdir: 'out',
outdir: OUT_DIR,
packages: 'external',
external: ['vscode'],
format: 'cjs',
sourcemap: !isProduction,
minify: isProduction,
platform: 'node',
logLevel: 'info',
plugins: [
copyPlugin({
src: './src/assets',
dest: './out/assets',
src: 'src/assets',
dest: `${OUT_DIR}/assets`,
}),
copyPlugin({
src: 'node_modules/@cnblogs/code-highlight-adapter/index.min.css',
dest: `${OUT_DIR}/assets/styles/highlight-code-lines.css`,
}),
copyPlugin({
src: 'src/wasm/rs_bg.wasm',
dest: `${OUT_DIR}/rs_bg.wasm`,
}),
],
}
Expand Down

0 comments on commit 13cb44a

Please sign in to comment.