-
Notifications
You must be signed in to change notification settings - Fork 1
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
Default export exposed as named default
#8
Comments
I'll try to fix the packaging, but in the meantime you should be able to do this: const postcssAssignLayer = require('postcss-assign-layer').default;
module.exports = {
plugins: [
postcssAssignLayer({
include: 'core/*.module.css',
layerName: 'core',
}),
],
} |
default
Actually, Next does not seem to support
I am currently in the same situation, it works on Storybook for example, but not on Next.js |
@mdaoust-sidlee If you need to use esm, you can still do that with a workaround until I fix the packaging here: import {default as postcssAssignLayer} from 'postcss-assign-layer';
export default {
plugins: [
postcssAssignLayer({
include: 'core/*.module.css',
layerName: 'core',
}),
],
} |
Oh I see, next.js requires commonjs, but no use of |
I released a fix in version |
It works!! Many thanks for the super quick fix 🙏. For anyone else working with Next.js, here is what the postcss config should look like with this plugin.
|
when using this with Next.js using the string plugin format Next spits out a type error when applying the config
TypeError: require(...) is not a function
From what I can tell this has to do with how the plugin is built. Next is calling
require(pluginPath)(options)
where as the plugin is exportingdefault
which would require it to callrequire(pluginPath).default(options)
The text was updated successfully, but these errors were encountered: