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

plugin-utils: esm import not working #131

Closed
alexanderniebuhr opened this issue Apr 6, 2021 · 4 comments · Fixed by windicss/windicss-intellisense#86
Closed

plugin-utils: esm import not working #131

alexanderniebuhr opened this issue Apr 6, 2021 · 4 comments · Fixed by windicss/windicss-intellisense#86
Assignees
Labels
bug Something isn't working

Comments

@alexanderniebuhr
Copy link
Member

alexanderniebuhr commented Apr 6, 2021

repo to reproduce if you want: https://github.com/alexanderniebuhr/svelte-sveasy-windicss. package.json has type: module

[windicss-plugin-utils] failed to load config "C:\Users\Alexander\Documents\projects\alexanderniebuhr\svelte-sveasy-windicss\windi.config.js"
[windicss-plugin-utils] Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\Users\Alexander\Documents\projects\alexanderniebuhr\svelte-sveasy-windicss\windi.config.js   
require() of ES modules is not supported.
require() of C:\Users\Alexander\Documents\projects\alexanderniebuhr\svelte-sveasy-windicss\windi.config.js from C:\Users\Alexander\Documents\projects\alexanderniebuhr\svelte-sveasy-windicss\node_modules\.pnpm\@windicss\[email protected]\node_modules\@windicss\plugin-utils\dist\index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
//@ts-check
import { defineConfig } from "windicss/helpers"
import forms from 'windicss/plugin/forms'
import lineClamp from "windicss/plugin/line-clamp"
import typography from "windicss/plugin/typography"

export default defineConfig({
  theme: {
    extend: {
      colors: {

      }
    }
  },
  plugins: [
    forms,
    lineClamp,
    typography
  ]
})
@alexanderniebuhr alexanderniebuhr added the bug Something isn't working label Apr 6, 2021
@alexanderniebuhr
Copy link
Member Author

@alexanderniebuhr
Copy link
Member Author

also depends partial on windicss/svelte-windicss-preprocess#104

@alexanderniebuhr
Copy link
Member Author

@alexanderniebuhr
Copy link
Member Author

i'll try to make a pr over the weekend

@antfu antfu closed this as completed in 7c46f1f Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants