cibernox / svelte-intl-precompile

I18n library for Svelte.js that analyzes your keys at build time for max performance and minimal footprint
https://svelte-intl-precompile.com
ISC License
274 stars 13 forks source link

Can't properly import for new ES6 modules config file #4

Closed stalkerg closed 3 years ago

stalkerg commented 3 years ago

Currently, svelte.config.js is an ES6 module and svelte-intl-precompile should support it. In the current situation, I should write:

import precompileIntl from 'svelte-intl-precompile/sveltekit-plugin.js';
cibernox commented 3 years ago

Interesting, I have svelte.config.cjs so just use const precompileIntl = require("svelte-intl-precompile/sveltekit-plugin");

I might have to generate both systems

cibernox commented 3 years ago

I just released 0.3.0 that allows you to use import precompileIntl from 'svelte-intl-precompile/sveltekit-plugin.js';

I also updated the readme since sveltekit is now generating a svelte.config.js by default (it used to generate a svelte.config.cjs before).