mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-24 04:20:34 +03:00
chore: use buble again for rollup and also replace
This commit is contained in:
committed by
Alexander Lichter
parent
7cf4efd290
commit
02c7beb6de
+3
-2
@@ -36,7 +36,7 @@
|
|||||||
"typings": "types/index.d.ts",
|
"typings": "types/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "yarn build:other && yarn build:es",
|
"build": "yarn build:other && yarn build:es",
|
||||||
"build:es": "rimraf es && babel src --env-name es --out-dir es --ignore 'src/browser.js'",
|
"build:es": "rimraf es && babel src --env-name es --out-dir es",
|
||||||
"build:other": "rimraf lib && rollup -c scripts/rollup.config.js",
|
"build:other": "rimraf lib && rollup -c scripts/rollup.config.js",
|
||||||
"coverage": "codecov",
|
"coverage": "codecov",
|
||||||
"predeploy": "git checkout master && git pull -r",
|
"predeploy": "git checkout master && git pull -r",
|
||||||
@@ -93,10 +93,11 @@
|
|||||||
"puppeteer-core": "^1.13.0",
|
"puppeteer-core": "^1.13.0",
|
||||||
"rimraf": "^2.6.3",
|
"rimraf": "^2.6.3",
|
||||||
"rollup": "^1.6.0",
|
"rollup": "^1.6.0",
|
||||||
"rollup-plugin-babel": "^4.3.2",
|
"rollup-plugin-buble": "^0.19.6",
|
||||||
"rollup-plugin-commonjs": "^9.2.1",
|
"rollup-plugin-commonjs": "^9.2.1",
|
||||||
"rollup-plugin-json": "^3.1.0",
|
"rollup-plugin-json": "^3.1.0",
|
||||||
"rollup-plugin-node-resolve": "^4.0.1",
|
"rollup-plugin-node-resolve": "^4.0.1",
|
||||||
|
"rollup-plugin-replace": "^2.1.0",
|
||||||
"rollup-plugin-terser": "^4.0.4",
|
"rollup-plugin-terser": "^4.0.4",
|
||||||
"update-section": "^0.3.3",
|
"update-section": "^0.3.3",
|
||||||
"vue": "^2.6.8",
|
"vue": "^2.6.8",
|
||||||
|
|||||||
+22
-14
@@ -1,7 +1,8 @@
|
|||||||
import commonjs from 'rollup-plugin-commonjs'
|
import commonjs from 'rollup-plugin-commonjs'
|
||||||
import nodeResolve from 'rollup-plugin-node-resolve'
|
import nodeResolve from 'rollup-plugin-node-resolve'
|
||||||
import json from 'rollup-plugin-json'
|
import json from 'rollup-plugin-json'
|
||||||
import babel from 'rollup-plugin-babel'
|
import buble from 'rollup-plugin-buble'
|
||||||
|
import replace from 'rollup-plugin-replace'
|
||||||
import { terser } from 'rollup-plugin-terser'
|
import { terser } from 'rollup-plugin-terser'
|
||||||
import defaultsDeep from 'lodash/defaultsDeep'
|
import defaultsDeep from 'lodash/defaultsDeep'
|
||||||
|
|
||||||
@@ -19,6 +20,21 @@ function rollupConfig({
|
|||||||
...config
|
...config
|
||||||
}) {
|
}) {
|
||||||
|
|
||||||
|
const replaceConfig = {
|
||||||
|
exclude: 'node_modules/**',
|
||||||
|
delimiters: ['', ''],
|
||||||
|
values: {
|
||||||
|
// replaceConfig needs to have some values
|
||||||
|
'const polyfill = process.env.NODE_ENV === \'test\'': 'const polyfill = false',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!config.output.format || config.output.format === 'umd') {
|
||||||
|
replaceConfig.values = {
|
||||||
|
'const polyfill = process.env.NODE_ENV === \'test\'': 'const polyfill = true',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return defaultsDeep({}, config, {
|
return defaultsDeep({}, config, {
|
||||||
input: 'src/browser.js',
|
input: 'src/browser.js',
|
||||||
output: {
|
output: {
|
||||||
@@ -29,28 +45,20 @@ function rollupConfig({
|
|||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
json(),
|
json(),
|
||||||
nodeResolve()
|
nodeResolve(),
|
||||||
|
replace(replaceConfig)
|
||||||
].concat(plugins),
|
].concat(plugins),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const babelConfig = {
|
|
||||||
runtimeHelpers: true,
|
|
||||||
exclude : 'node_modules/**',
|
|
||||||
presets: [['@nuxt/babel-preset-app', {
|
|
||||||
// useBuiltIns: 'usage',
|
|
||||||
// target: { ie: 9 }
|
|
||||||
}]]
|
|
||||||
}
|
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
rollupConfig({
|
rollupConfig({
|
||||||
output: {
|
output: {
|
||||||
file: pkg.web,
|
file: pkg.web,
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
babel(babelConfig),
|
commonjs(),
|
||||||
commonjs()
|
buble()
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
rollupConfig({
|
rollupConfig({
|
||||||
@@ -58,8 +66,8 @@ export default [
|
|||||||
file: pkg.web.replace('.js', '.min.js'),
|
file: pkg.web.replace('.js', '.min.js'),
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
babel(babelConfig),
|
|
||||||
commonjs(),
|
commonjs(),
|
||||||
|
buble(),
|
||||||
terser()
|
terser()
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -2016,6 +2016,18 @@ bser@^2.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
node-int64 "^0.4.0"
|
node-int64 "^0.4.0"
|
||||||
|
|
||||||
|
buble@^0.19.6:
|
||||||
|
version "0.19.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/buble/-/buble-0.19.6.tgz#915909b6bd5b11ee03b1c885ec914a8b974d34d3"
|
||||||
|
integrity sha512-9kViM6nJA1Q548Jrd06x0geh+BG2ru2+RMDkIHHgJY/8AcyCs34lTHwra9BX7YdPrZXd5aarkpr/SY8bmPgPdg==
|
||||||
|
dependencies:
|
||||||
|
chalk "^2.4.1"
|
||||||
|
magic-string "^0.25.1"
|
||||||
|
minimist "^1.2.0"
|
||||||
|
os-homedir "^1.0.1"
|
||||||
|
regexpu-core "^4.2.0"
|
||||||
|
vlq "^1.0.0"
|
||||||
|
|
||||||
buffer-from@^1.0.0:
|
buffer-from@^1.0.0:
|
||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
|
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
|
||||||
@@ -2118,7 +2130,7 @@ chalk@^1.1.3:
|
|||||||
strip-ansi "^3.0.0"
|
strip-ansi "^3.0.0"
|
||||||
supports-color "^2.0.0"
|
supports-color "^2.0.0"
|
||||||
|
|
||||||
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.2:
|
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1, chalk@^2.4.2:
|
||||||
version "2.4.2"
|
version "2.4.2"
|
||||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
|
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
|
||||||
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
|
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
|
||||||
@@ -5181,7 +5193,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1:
|
|||||||
resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
|
resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
|
||||||
integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=
|
integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=
|
||||||
|
|
||||||
minimatch@^3.0.3, minimatch@^3.0.4:
|
minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4:
|
||||||
version "3.0.4"
|
version "3.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
||||||
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
|
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
|
||||||
@@ -5593,7 +5605,7 @@ os-browserify@^0.3.0:
|
|||||||
resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27"
|
resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27"
|
||||||
integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=
|
integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=
|
||||||
|
|
||||||
os-homedir@^1.0.0:
|
os-homedir@^1.0.0, os-homedir@^1.0.1:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
|
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
|
||||||
integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M=
|
integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M=
|
||||||
@@ -6454,13 +6466,13 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
|
|||||||
hash-base "^3.0.0"
|
hash-base "^3.0.0"
|
||||||
inherits "^2.0.1"
|
inherits "^2.0.1"
|
||||||
|
|
||||||
rollup-plugin-babel@^4.3.2:
|
rollup-plugin-buble@^0.19.6:
|
||||||
version "4.3.2"
|
version "0.19.6"
|
||||||
resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-4.3.2.tgz#8c0e1bd7aa9826e90769cf76895007098ffd1413"
|
resolved "https://registry.yarnpkg.com/rollup-plugin-buble/-/rollup-plugin-buble-0.19.6.tgz#55ee0995d8870d536f01f4277c3eef4276e8747e"
|
||||||
integrity sha512-KfnizE258L/4enADKX61ozfwGHoqYauvoofghFJBhFnpH9Sb9dNPpWg8QHOaAfVASUYV8w0mCx430i9z0LJoJg==
|
integrity sha512-El5Fut4/wEO17ZN/n9BZvqd7DXXB2WbJr/DKvr89LXChC/cHllE0XwiUDeAalrTkgr0WrnyLDTCQvEv+cGywWQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/helper-module-imports" "^7.0.0"
|
buble "^0.19.6"
|
||||||
rollup-pluginutils "^2.3.0"
|
rollup-pluginutils "^2.3.3"
|
||||||
|
|
||||||
rollup-plugin-commonjs@^9.2.1:
|
rollup-plugin-commonjs@^9.2.1:
|
||||||
version "9.2.1"
|
version "9.2.1"
|
||||||
@@ -6488,6 +6500,15 @@ rollup-plugin-node-resolve@^4.0.1:
|
|||||||
is-module "^1.0.0"
|
is-module "^1.0.0"
|
||||||
resolve "^1.10.0"
|
resolve "^1.10.0"
|
||||||
|
|
||||||
|
rollup-plugin-replace@^2.1.0:
|
||||||
|
version "2.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/rollup-plugin-replace/-/rollup-plugin-replace-2.1.0.tgz#f9c07a4a89a2f8be912ee54b3f0f68d91e9ed0ae"
|
||||||
|
integrity sha512-SxrAIgpH/B5/W4SeULgreOemxcpEgKs2gcD42zXw50bhqGWmcnlXneVInQpAqzA/cIly4bJrOpeelmB9p4YXSQ==
|
||||||
|
dependencies:
|
||||||
|
magic-string "^0.25.1"
|
||||||
|
minimatch "^3.0.2"
|
||||||
|
rollup-pluginutils "^2.0.1"
|
||||||
|
|
||||||
rollup-plugin-terser@^4.0.4:
|
rollup-plugin-terser@^4.0.4:
|
||||||
version "4.0.4"
|
version "4.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-4.0.4.tgz#6f661ef284fa7c27963d242601691dc3d23f994e"
|
resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-4.0.4.tgz#6f661ef284fa7c27963d242601691dc3d23f994e"
|
||||||
@@ -6498,7 +6519,7 @@ rollup-plugin-terser@^4.0.4:
|
|||||||
serialize-javascript "^1.6.1"
|
serialize-javascript "^1.6.1"
|
||||||
terser "^3.14.1"
|
terser "^3.14.1"
|
||||||
|
|
||||||
rollup-pluginutils@^2.3.0:
|
rollup-pluginutils@^2.0.1:
|
||||||
version "2.4.1"
|
version "2.4.1"
|
||||||
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.4.1.tgz#de43ab54965bbf47843599a7f3adceb723de38db"
|
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.4.1.tgz#de43ab54965bbf47843599a7f3adceb723de38db"
|
||||||
integrity sha512-wesMQ9/172IJDIW/lYWm0vW0LiKe5Ekjws481R7z9WTRtmO59cqyM/2uUlxvf6yzm/fElFmHUobeQOYz46dZJw==
|
integrity sha512-wesMQ9/172IJDIW/lYWm0vW0LiKe5Ekjws481R7z9WTRtmO59cqyM/2uUlxvf6yzm/fElFmHUobeQOYz46dZJw==
|
||||||
@@ -7510,6 +7531,11 @@ vfile@^2.0.0:
|
|||||||
unist-util-stringify-position "^1.0.0"
|
unist-util-stringify-position "^1.0.0"
|
||||||
vfile-message "^1.0.0"
|
vfile-message "^1.0.0"
|
||||||
|
|
||||||
|
vlq@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/vlq/-/vlq-1.0.0.tgz#8101be90843422954c2b13eb27f2f3122bdcc806"
|
||||||
|
integrity sha512-o3WmXySo+oI5thgqr7Qy8uBkT/v9Zr+sRyrh1lr8aWPUkgDWdWt4Nae2WKBrLsocgE8BuWWD0jLc+VW8LeU+2g==
|
||||||
|
|
||||||
vm-browserify@0.0.4:
|
vm-browserify@0.0.4:
|
||||||
version "0.0.4"
|
version "0.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73"
|
resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73"
|
||||||
|
|||||||
Reference in New Issue
Block a user