Skip to content
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

rollup 2.11 gave me error #1

Open
lightingland opened this issue Jun 5, 2020 · 1 comment
Open

rollup 2.11 gave me error #1

lightingland opened this issue Jun 5, 2020 · 1 comment

Comments

@lightingland
Copy link

lightingland commented Jun 5, 2020

plugins in rollup.config.js:

import svelte from 'rollup-plugin-svelte'
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import { terser } from 'rollup-plugin-terser'
import sveltePreprocess from 'svelte-preprocess'
import { _preprocess__svg as svg } from '@ctx-core/svg/svelte'
import { _preprocess as ctxcore } from '@ctx-core/svelte/preprocess'

error log ==============================================
[!] SyntaxError: Cannot use import statement outside a module
/home/node/my-svelte/node_modules/@ctx-core/svg/svelte.js:1
import { extname } from 'path';
^^^^^^

SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:1054:16)
at Module._compile (internal/modules/cjs/loader.js:1102:27)
at Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at require.extensions. (/home/node/my-svelte/node_modules/rollup/dist/shared/loadConfigFile.js:519:13)
at Object.require.extensions. [as .js] (/home/node/my-svelte/node_modules/rollup/dist/shared/loadConfigFile.js:519:13)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (/home/node/my-svelte/rollup.config.js:12:16)

@lightingland
Copy link
Author

lightingland commented Jun 5, 2020

Since commonjs() used to convert other cjs module to es6. How the natural born es6 plugin like ctx-core/svg co-work with commonjs module?
commonjs({ transformMixedEsModules: true, })
seems doesn't help.
check this out:
rollup/plugins#302

@lightingland lightingland changed the title rollup 2.11 give me error rollup 2.11 gave me error Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant