Skip to content

Commit

Permalink
feat: Improve compatibility with other plugins that uses query parame…
Browse files Browse the repository at this point in the history
…ters (vuejs#185)

change old query syntax:
{path}.vue?{ type: string, index?: number }#.{lang}

to:
{path}.vue.{lang}?rollup_plugin_vue={ type: string, lang: string, index?: number }

Plugins, like rollup-plugin-postcss also uses query params
for itself purpose, in this case if we provide { css: false } as options
to rollup-plugin-vue then we will get error from rollup, because
postcss can not recognize file ".vue?{...}#.css" as css file
and rollup-plugin-vue done its work also.

Rollup config where vue + postcss is not work:

export default [
  {
    input: '...',
    output: [
      {
        file: '...',
        format: 'es'
      }
    ],
    plugins: [
      // ...
      vue({
        css: false,
      }),
      postcss()
    ]
  }
];
  • Loading branch information
Hokid authored and znck committed May 5, 2018
1 parent 3d1d210 commit 4110dbb
Show file tree
Hide file tree
Showing 5 changed files with 6,715 additions and 1,876 deletions.
12 changes: 9 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"presets": [
[ "es2015", { "modules": false }],
"stage-2"
[
"@babel/preset-env",
{
"target": "node"
}
]
],
"plugins": [
"@babel/transform-runtime"
],
"plugins": ["transform-runtime"],
"retainLines": true,
"comments": true
}
Loading

0 comments on commit 4110dbb

Please sign in to comment.