Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Commit

Permalink
docs: Add CommonJS plugin in example as it's required in most cases
Browse files Browse the repository at this point in the history
If rollup-plugin-commonjs is not used, rollup complains:

  Error: 'default' is not exported by node_modules/vue-runtime-helpers/dist/normalize-component.js
  • Loading branch information
multics authored and znck committed Jan 26, 2019
1 parent dcd18a7 commit fd3dfb9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Expand Up @@ -22,11 +22,15 @@ With rollup you can break your application into reusable modules.
> This document applies to v4.0+. If you are looking for older versions, docs are [here](https://github.com/vuejs/rollup-plugin-vue/tree/2.2/docs)
```js
import commonjs from 'rollup-plugin-commonjs'
import VuePlugin from 'rollup-plugin-vue'

export default {
entry: 'main.js',
plugins: [VuePlugin(/* VuePluginOptions */)]
plugins: [
commonjs(),
VuePlugin(/* VuePluginOptions */)
]
}
```

Expand Down

1 comment on commit fd3dfb9

@jschatz1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this. Why should we need to this for a umd config? It solved my problem, but I don't understand why we would need it.

  {
    input: 'examples/main.js',
    output: {
      file: 'examples/dist/examples.js',
      format: 'umd',
      name: 'VuecExamples'
    },
    plugins: [
      resolve(),
      babel({
        exclude: 'node_modules/**'
      }),
      commonjs(),
      vue(),
    ]
  },

Please sign in to comment.