代码拉取完成,页面将自动刷新
import path from 'path';
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js';
import license from 'rollup-plugin-license';
import * as pkg from './package.json';
const NODE_ENV = process.argv.mode || 'development';
const VERSION = pkg.version;
/**
* Trick to use Vite server.open option on macOS
* @see https://github.com/facebook/create-react-app/pull/1690#issuecomment-283518768
*/
process.env.BROWSER = 'open';
export default {
build: {
copyPublicDir: false,
lib: {
entry: path.resolve(__dirname, 'src', 'codex.ts'),
name: 'EditorJS',
fileName: 'editorjs',
},
rollupOptions: {
plugins: [
license({
thirdParty: {
allow: {
test: (dependency) => {
// Manually allow html-janitor (https://github.com/guardian/html-janitor/blob/master/LICENSE)
// because of missing LICENSE file in published package
if (dependency.name === 'html-janitor') {
return true;
}
// Return false for unlicensed dependencies.
if (!dependency.license) {
return false;
}
// Allow MIT and Apache-2.0 licenses.
return ['MIT', 'Apache-2.0'].includes(dependency.license);
},
failOnUnlicensed: true,
failOnViolation: true,
},
output: path.resolve(__dirname, 'dist', 'vendor.LICENSE.txt'),
},
}),
],
},
},
define: {
'NODE_ENV': JSON.stringify(NODE_ENV),
'VERSION': JSON.stringify(VERSION),
},
resolve: {
alias: {
'@/types': path.resolve(__dirname, './types'),
},
},
server: {
port: 3303,
open: true,
},
plugins: [
cssInjectedByJsPlugin(),
],
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。