You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

35 lines
904 B

/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path');
const { lessLoader } = require('esbuild-plugin-less');
require('esbuild')
.build({
bundle: true,
entryPoints: [path.join(__dirname, 'template/app.jsx')],
outfile: path.join(__dirname, 'template/dist/app.bundle.js'),
plugins: [
// fix import('antd/dist/antd.less')
{
name: 'resolve-antd-dist-less',
setup: (build) => {
build.onResolve(
{ filter: /antd\/dist\/antd\.less$/, namespace: 'file' },
() => {
return {
path: '',
watchFiles: undefined,
};
},
);
},
},
// less
lessLoader({
javascriptEnabled: true,
}),
],
})
.then(() => {
console.log('imove editor builded');
})
.catch(() => process.exit(1));