You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
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
changed the title
rollup 2.11 give me error
rollup 2.11 gave me error
Jun 6, 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)
The text was updated successfully, but these errors were encountered: