11ty / eleventy-plugin-vue

Use Vue.js templates and Vue.js single file components in Eleventy.
196 stars 11 forks source link

rollupPluginVueOptions 'exclude' throws error: Unexpected token (Note that you need plugins to import files that are not JavaScript) #30

Closed gluecksmensch closed 3 years ago

gluecksmensch commented 3 years ago

When using the rollupPluginVueOptions with the exclude option

eleventyConfig.addPlugin(
    eleventyVue,
    {
      rollupPluginVueOptions: {
        exclude: ["src/js/**.*"],
      },
    }
  );

after ELEVENTY_EXPERIMENTAL=true ELEVENTY_ENV=production eleventy eleventy throws an error:

Problem writing Eleventy templates: (more in DEBUG output)
> Unexpected token (Note that you need plugins to import files that are not JavaScript)

`Error` was thrown:
    Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
        at error (/Users/dh/Projects/magix/node_modules/rollup/dist/shared/rollup.js:5279:30)
        at Module.error (/Users/dh/Projects/magix/node_modules/rollup/dist/shared/rollup.js:9996:16)
        at tryParse (/Users/dh/Projects/magix/node_modules/rollup/dist/shared/rollup.js:9855:23)
        at Module.setSource (/Users/dh/Projects/magix/node_modules/rollup/dist/shared/rollup.js:10303:19)
        at ModuleLoader.addModuleSource (/Users/dh/Projects/magix/node_modules/rollup/dist/shared/rollup.js:18603:20)
        at async ModuleLoader.fetchModule (/Users/dh/Projects/magix/node_modules/rollup/dist/shared/rollup.js:18659:9)
        at async Promise.all (index 1)

Node: v14.15.4 npm: 6.14.10

gluecksmensch commented 3 years ago

Moved the src/js folder to eleventy _includes folder.