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

feat: more compatibility with other plugins that uses query parameters #185

Merged
merged 1 commit into from
May 5, 2018

Conversation

Hokid
Copy link

@Hokid Hokid commented May 5, 2018

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 has done its work also.

Rollup config where vue + postcss is not work:

export default [
  {
    input: '...',
    output: [
      {
        file: '...',
        format: 'es'
      }
    ],
    plugins: [
      // ...
      vue({
        css: false,
      }),
      postcss()
    ]
  }
];

/ping @znck

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()
    ]
  }
];
@Hokid
Copy link
Author

Hokid commented May 5, 2018

this PR may resolve #177 , but i not been test it.

@znck znck merged commit 4110dbb into vuejs:master May 5, 2018
@Hokid Hokid deleted the feat-more-compatibility branch May 6, 2018 02:21
znck added a commit to znck/rollup-plugin-vue that referenced this pull request May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants