Add rollup & multitarget support#11
Add rollup & multitarget support#11stevefan1999-personal wants to merge 12 commits intoyoyo930021:masterfrom
Conversation
|
|
||
| program | ||
| .version(require('../../package.json').version) | ||
| .version(version) |
There was a problem hiding this comment.
This version is wrong on release.
Because bundling is before upgrading package.json version.
| tsconfig: 'tsconfig.compile.json' | ||
| }) | ||
| const pluginJson = json() | ||
| const pluginCommonJs = commonjs() |
There was a problem hiding this comment.
The pluginCommonJs is needed when any output.
Because it is converting CommonJS modules to ES6 for dependencies
| file: 'dist/index.browser.mjs', | ||
| format: 'es' | ||
| }, | ||
| plugins: [replace({ 'process.env.BROWSER': 'true' }), pluginJson, pluginTypeScript] |
There was a problem hiding this comment.
I think we can replace process.env.BROWSER to __BROWSER__.
| export function format (content: string, options: Vc2cOptions): string { | ||
| const isNode = typeof window === 'undefined' | ||
| if (!isNode) { | ||
| if (process.env.BROWSER || !isNode) { |
| @@ -1 +1,4 @@ | |||
| declare module 'prettier-eslint' | |||
| declare module 'prettier-eslint' { | |||
| const ret: any | |||
There was a problem hiding this comment.
I don't know why about this code?
| const scriptContent = parseVueFile(options.vueTemplateCompiler, fileContent).script | ||
| if (scriptContent) { | ||
| log(`Readed Vue file: ${fileFsPath}`) | ||
| if (scriptContent?.content != null) { |
| @@ -0,0 +1,46 @@ | |||
| import commonjs from '@rollup/plugin-commonjs' | |||
| import json from '@rollup/plugin-json' | |||
| import replace from '@rollup/plugin-replace' | |||
There was a problem hiding this comment.
We need to add replace({ 'process.env.BROWSER': 'false' }) for outputs without browser.
|
Thanks for contribution. |
| setupPropsKey: string | ||
| setupContextKey: string | ||
| typesciprt: typeof ts | ||
| typescript: typeof ts |
|
This project is use this commit message style. |
Now we that we used rollup we can pack this in webpack at a much faster speed
Fixes #10