mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2025-07-02 10:03:25 +08:00
feat: add umd bundle (#457)
This commit is contained in:
@ -5,6 +5,14 @@ module.exports = {
|
||||
],
|
||||
plugins: [
|
||||
/* eslint-disable-next-line global-require */
|
||||
[require('./dist/index.js'), { optimize: true, isCustomElement: (tag) => /^x-/.test(tag) }],
|
||||
[
|
||||
!process.env.MODE
|
||||
? require('./dist/index.js')
|
||||
: require('./dist/vue-jsx.min.js'),
|
||||
{
|
||||
optimize: true,
|
||||
isCustomElement: (tag) => /^x-/.test(tag)
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
|
@ -6,14 +6,15 @@
|
||||
"homepage": "https://github.com/vuejs/jsx-next/tree/dev/packages/babel-plugin-jsx#readme",
|
||||
"license": "MIT",
|
||||
"main": "dist/index.js",
|
||||
"unpkg": "dist/vue-jsx.min.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/jsx-next.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"build": "rm -rf dist && tsc && rollup -c rollup.config.js",
|
||||
"lint": "eslint 'src/*.ts'",
|
||||
"test": "yarn build && jest --coverage",
|
||||
"test": "yarn build && jest --coverage && jest --clearCache && MODE=umd jest --coverage",
|
||||
"prepublishOnly": "yarn build"
|
||||
},
|
||||
"bugs": {
|
||||
@ -42,8 +43,11 @@
|
||||
"@typescript-eslint/parser": "^4.0.1",
|
||||
"@vue/compiler-dom": "3.0.5",
|
||||
"@vue/test-utils": "2.0.0-beta.2",
|
||||
"esbuild": "^0.12.9",
|
||||
"jest": "^26.0.1",
|
||||
"regenerator-runtime": "^0.13.5",
|
||||
"rollup": "^2.52.2",
|
||||
"rollup-plugin-esbuild": "^4.5.0",
|
||||
"ts-jest": "^26.1.3",
|
||||
"typescript": "^4.2.3",
|
||||
"vue": "3.0.7"
|
||||
|
17
packages/babel-plugin-jsx/rollup.config.js
Normal file
17
packages/babel-plugin-jsx/rollup.config.js
Normal file
@ -0,0 +1,17 @@
|
||||
import esbuild from 'rollup-plugin-esbuild'
|
||||
|
||||
export default {
|
||||
input: 'src/index.ts',
|
||||
output: [
|
||||
{
|
||||
file: `dist/vue-jsx.min.js`,
|
||||
format: 'umd',
|
||||
name: `vue-jsx`,
|
||||
},
|
||||
],
|
||||
plugins: [
|
||||
esbuild({
|
||||
minify: true,
|
||||
}),
|
||||
],
|
||||
}
|
Reference in New Issue
Block a user