mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(rollup): fix build warnings
This commit is contained in:
parent
445fce1312
commit
727ef16920
@ -1,5 +1,5 @@
|
||||
import hash from 'hash-sum'
|
||||
import uniq from 'lodash/uniq'
|
||||
import { uniq } from 'lodash'
|
||||
import { isJS, isCSS, onEmit } from './util'
|
||||
|
||||
export default class VueSSRClientPlugin {
|
||||
|
@ -164,8 +164,7 @@
|
||||
"rollup": "^0.59.4",
|
||||
"rollup-plugin-babel": "^3.0.4",
|
||||
"rollup-plugin-commonjs": "^9.1.3",
|
||||
"rollup-plugin-json": "^3.0.0",
|
||||
"rollup-plugin-node-resolve": "^3.3.0"
|
||||
"rollup-plugin-json": "^3.0.0"
|
||||
},
|
||||
"collective": {
|
||||
"type": "opencollective",
|
||||
|
21
scripts/rollup/externals.js
Normal file
21
scripts/rollup/externals.js
Normal 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
|
@ -1,8 +1,9 @@
|
||||
import nodeResolve from 'rollup-plugin-node-resolve'
|
||||
import json from 'rollup-plugin-json'
|
||||
import commonjs from 'rollup-plugin-commonjs'
|
||||
import defaultsDeep from 'lodash/defaultsDeep'
|
||||
|
||||
import externals from './externals'
|
||||
|
||||
export default ({ name, input, plugins = [], options }) => defaultsDeep({}, options, {
|
||||
input,
|
||||
output: {
|
||||
@ -10,13 +11,8 @@ export default ({ name, input, plugins = [], options }) => defaultsDeep({}, opti
|
||||
format: 'cjs',
|
||||
sourcemap: true
|
||||
},
|
||||
external: externals,
|
||||
plugins: [
|
||||
nodeResolve({
|
||||
modulesOnly: true,
|
||||
preferBuiltins: true,
|
||||
only: ['./'],
|
||||
extensions: ['.mjs', '.js']
|
||||
}),
|
||||
commonjs(),
|
||||
json()
|
||||
].concat(plugins)
|
||||
|
16
yarn.lock
16
yarn.lock
@ -1428,10 +1428,6 @@ builtin-modules@^1.0.0:
|
||||
version "1.1.1"
|
||||
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:
|
||||
version "3.0.0"
|
||||
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:
|
||||
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:
|
||||
version "2.1.0"
|
||||
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:
|
||||
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:
|
||||
version "1.5.2"
|
||||
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408"
|
||||
|
Loading…
Reference in New Issue
Block a user