fix(rollup): fix build warnings

This commit is contained in:
Pooya Parsa 2018-06-01 16:30:17 +04:30
parent 445fce1312
commit 727ef16920
5 changed files with 26 additions and 26 deletions

View File

@ -1,5 +1,5 @@
import hash from 'hash-sum' import hash from 'hash-sum'
import uniq from 'lodash/uniq' import { uniq } from 'lodash'
import { isJS, isCSS, onEmit } from './util' import { isJS, isCSS, onEmit } from './util'
export default class VueSSRClientPlugin { export default class VueSSRClientPlugin {

View File

@ -164,8 +164,7 @@
"rollup": "^0.59.4", "rollup": "^0.59.4",
"rollup-plugin-babel": "^3.0.4", "rollup-plugin-babel": "^3.0.4",
"rollup-plugin-commonjs": "^9.1.3", "rollup-plugin-commonjs": "^9.1.3",
"rollup-plugin-json": "^3.0.0", "rollup-plugin-json": "^3.0.0"
"rollup-plugin-node-resolve": "^3.3.0"
}, },
"collective": { "collective": {
"type": "opencollective", "type": "opencollective",

View File

@ -0,0 +1,21 @@
import pkg from '../../package.json'
// Dependencies that will be installed alongise with nuxt package
const packageDependencies = Object.keys(pkg.dependencies)
// Allow built in node modules
const nodeBuiltIn = ['path', 'fs', 'module', 'crypto', 'util']
// Optional dependencies that user should install on demand
const optionalDependencies = [
// legacy build users need this
'babel-polyfill'
]
const externals = [].concat(
packageDependencies,
nodeBuiltIn,
optionalDependencies
)
export default externals

View File

@ -1,8 +1,9 @@
import nodeResolve from 'rollup-plugin-node-resolve'
import json from 'rollup-plugin-json' import json from 'rollup-plugin-json'
import commonjs from 'rollup-plugin-commonjs' import commonjs from 'rollup-plugin-commonjs'
import defaultsDeep from 'lodash/defaultsDeep' import defaultsDeep from 'lodash/defaultsDeep'
import externals from './externals'
export default ({ name, input, plugins = [], options }) => defaultsDeep({}, options, { export default ({ name, input, plugins = [], options }) => defaultsDeep({}, options, {
input, input,
output: { output: {
@ -10,13 +11,8 @@ export default ({ name, input, plugins = [], options }) => defaultsDeep({}, opti
format: 'cjs', format: 'cjs',
sourcemap: true sourcemap: true
}, },
external: externals,
plugins: [ plugins: [
nodeResolve({
modulesOnly: true,
preferBuiltins: true,
only: ['./'],
extensions: ['.mjs', '.js']
}),
commonjs(), commonjs(),
json() json()
].concat(plugins) ].concat(plugins)

View File

@ -1428,10 +1428,6 @@ builtin-modules@^1.0.0:
version "1.1.1" version "1.1.1"
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
builtin-modules@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-2.0.0.tgz#60b7ef5ae6546bd7deefa74b08b62a43a232648e"
builtin-status-codes@^3.0.0: builtin-status-codes@^3.0.0:
version "3.0.0" version "3.0.0"
resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8"
@ -3772,10 +3768,6 @@ is-glob@^4.0.0:
dependencies: dependencies:
is-extglob "^2.1.1" is-extglob "^2.1.1"
is-module@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591"
is-number@^2.1.0: is-number@^2.1.0:
version "2.1.0" version "2.1.0"
resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f"
@ -6605,14 +6597,6 @@ rollup-plugin-json@^3.0.0:
dependencies: dependencies:
rollup-pluginutils "^2.2.0" rollup-pluginutils "^2.2.0"
rollup-plugin-node-resolve@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.3.0.tgz#c26d110a36812cbefa7ce117cadcd3439aa1c713"
dependencies:
builtin-modules "^2.0.0"
is-module "^1.0.0"
resolve "^1.1.6"
rollup-pluginutils@^1.5.0: rollup-pluginutils@^1.5.0:
version "1.5.2" version "1.5.2"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408"