Skip to content

Commit

Permalink
feat(rollup): add rollup-plugin-vue support
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Feb 8, 2020
1 parent 4012a6b commit 4a31cff
Show file tree
Hide file tree
Showing 7 changed files with 405 additions and 316 deletions.
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@
"w:dev": "ts-node -T --files packages/webpack/src/cli"
},
"devDependencies": {
"@1stg/app-config": "^0.3.0",
"@1stg/lib-config": "^0.3.0",
"@1stg/tslint-config": "^0.7.0",
"@angular/common": "^8.2.14",
"@angular/compiler": "^8.2.14",
"@angular/compiler-cli": "^8.2.14",
"@angular/core": "^8.2.14",
"@angular/platform-browser": "^8.2.14",
"@angular/platform-browser-dynamic": "^8.2.14",
"@1stg/app-config": "^0.3.2",
"@1stg/lib-config": "^0.3.2",
"@1stg/tslint-config": "^0.7.2",
"@angular/common": "^9.0.0",
"@angular/compiler": "^9.0.0",
"@angular/compiler-cli": "^9.0.0",
"@angular/core": "^9.0.0",
"@angular/platform-browser": "^9.0.0",
"@angular/platform-browser-dynamic": "^9.0.0",
"@babel/types": "^7.8.3",
"@d-ts/core": "^0.7.2",
"@d-ts/rollup-plugins": "^0.3.2",
Expand All @@ -65,7 +65,7 @@
"@types/friendly-errors-webpack-plugin": "^0.1.2",
"@types/imagemin": "^7.0.0",
"@types/is-glob": "^4.0.1",
"@types/jest": "^25.1.1",
"@types/jest": "^25.1.2",
"@types/lodash": "^4.14.149",
"@types/micromatch": "^4.0.1",
"@types/mini-css-extract-plugin": "^0.9.0",
Expand All @@ -77,7 +77,7 @@
"@types/resolve": "^1.14.0",
"@types/rollup-plugin-postcss": "^2.0.0",
"@types/rollup__plugin-url": "npm:@types/rollup-plugin-url",
"@types/webpack": "^4.41.4",
"@types/webpack": "^4.41.5",
"@types/webpack-dev-server": "^3.10.0",
"@types/webpack-env": "^1.15.1",
"@types/workbox-webpack-plugin": "^4.1.0",
Expand All @@ -94,7 +94,7 @@
"rxjs": "^6.5.4",
"serve": "^11.3.0",
"svelte": "^3.18.1",
"ts-jest": "^25.1.0",
"ts-jest": "^25.2.0",
"ts-node": "^8.6.2",
"tslint": "^6.0.0",
"type-coverage": "^2.4.0",
Expand All @@ -108,7 +108,7 @@
"@babel/preset-env": "^7.8.4",
"eslint-plugin-prettier": "^3.1.2",
"rollup": "^1.31.0",
"typescript": "~3.5.3"
"typescript": "^3.7.5"
},
"commitlint": {
"extends": [
Expand Down
3 changes: 2 additions & 1 deletion packages/rollup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@pkgr/utils": "^0.3.9",
"@rollup/plugin-commonjs": "^11.0.2",
"@rollup/plugin-json": "^4.0.2",
"@rollup/plugin-node-resolve": "^7.1.0",
"@rollup/plugin-node-resolve": "^7.1.1",
"@rollup/plugin-replace": "^2.3.1",
"@rollup/plugin-typescript": "^3.0.0",
"@rollup/plugin-url": "^4.0.2",
Expand All @@ -40,6 +40,7 @@
"rollup-plugin-copy": "^3.3.0",
"rollup-plugin-postcss": "^2.0.6",
"rollup-plugin-terser": "^5.2.0",
"rollup-plugin-vue": "^5.1.6",
"tslib": "^1.10.0"
},
"publishConfig": {
Expand Down
2 changes: 2 additions & 0 deletions packages/rollup/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ program
JSOX.parse,
)
.option('--postcss <JSOX>', 'options for `rollup-plugin-postcss`', JSOX.parse)
.option('--vue <JSOX>', 'options for `rollup-plugin-vue`', JSOX.parse)
.option(
'-d, --define [boolean | JSOX]',
'options for `rollup-plugin-replace`, enable `__DEV__` and `__PROD__` by default',
Expand Down Expand Up @@ -98,6 +99,7 @@ const options: ConfigOptions = pick(
'sourceMap',
'typescript',
'postcss',
'vue',
'terser',
'prod',
)
Expand Down
8 changes: 6 additions & 2 deletions packages/rollup/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import babel from 'rollup-plugin-babel'
import copy, { CopyOptions } from 'rollup-plugin-copy'
import postcss, { PostCssPluginOptions } from 'rollup-plugin-postcss'
import { Options as TerserOptions, terser } from 'rollup-plugin-terser'
import vue, { VuePluginOptions } from 'rollup-plugin-vue'

const info = debug('r:info')

Expand Down Expand Up @@ -152,6 +153,7 @@ export interface ConfigOptions {
sourceMap?: boolean
typescript?: RollupTypescriptOptions
postcss?: PostCssPluginOptions
vue?: VuePluginOptions
define?: boolean | {}
terser?: TerserOptions
prod?: boolean
Expand Down Expand Up @@ -186,7 +188,8 @@ export const config = ({
copies = [],
sourceMap = false,
typescript: typescriptOptions,
postcss: postcssOpts,
postcss: postcssOptions,
vue: vueOptions,
define,
terser: terserOptions,
prod = __PROD__,
Expand Down Expand Up @@ -368,7 +371,8 @@ ConfigOptions = {}): RollupOptions[] => {
copy(copyOptions),
json(),
url({ include: IMAGE_EXTENSIONS.map(ext => `**/*${ext}`) }),
postcss(postcssOpts),
postcss(postcssOptions),
vue(vueOptions),
].concat(
[
// __DEV__ and __PROD__ will always be replaced while `process.env.NODE_ENV` will be preserved except on production
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@pkgr/webpack": "^0.5.1"
},
"dependencies": {
"@ngtools/webpack": "^8.3.24"
"@ngtools/webpack": "^9.0.1"
},
"publishConfig": {
"access": "public"
Expand Down
6 changes: 3 additions & 3 deletions packages/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"index.pug"
],
"dependencies": {
"@1stg/babel-preset": "^0.11.0",
"@1stg/postcss-config": "^0.7.0",
"@1stg/babel-preset": "^0.11.2",
"@1stg/postcss-config": "^0.7.2",
"@babel/core": "^7.8.4",
"@pkgr/es-modules": "^0.2.4",
"@pkgr/umd-globals": "^0.3.3",
Expand Down Expand Up @@ -62,7 +62,7 @@
"tslib": "^1.10.0",
"url-loader": "^3.0.0",
"webpack": "^4.41.5",
"webpack-dev-server": "^3.10.2",
"webpack-dev-server": "^3.10.3",
"workbox-webpack-plugin": "^5.0.0"
},
"publishConfig": {
Expand Down
Loading

0 comments on commit 4a31cff

Please sign in to comment.