Skip to content

Update packaging-sfc-for-npm.md #2555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/v2/cookbook/packaging-sfc-for-npm.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ There is no need to write your module multiple times. It is possible to prepare
},
"devDependencies": {
"rollup": "^1.17.0",
"rollup-plugin-buble": "^0.19.8",
"rollup-plugin-commonjs": "^10.0.1",
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-commonjs": "^11.1.0",
"rollup-plugin-vue": "^5.0.1",
"vue": "^2.6.10",
"vue-template-compiler": "^2.6.10"
Expand Down Expand Up @@ -170,9 +170,9 @@ Notice the first line directly imports your SFC, and the last line exports it un
With the package.json `scripts` section ready and the SFC wrapper in place, all that is left is to ensure Rollup is properly configured. Fortunately, this can be done with a small 16 line rollup.config.js file:

```js
import commonjs from 'rollup-plugin-commonjs'; // Convert CommonJS modules to ES6
import commonjs from '@rollup/plugin-commonjs'; // Convert CommonJS modules to ES6
import vue from 'rollup-plugin-vue'; // Handle .vue SFC files
import buble from 'rollup-plugin-buble'; // Transpile/polyfill with reasonable browser support
import buble from '@rollup/plugin-buble'; // Transpile/polyfill with reasonable browser support
export default {
input: 'src/wrapper.js', // Path relative to package.json
output: {
Expand Down