simple-keyboard-layouts
simple-keyboard-layouts copied to clipboard
Add "type": "module" to package.json
Description
This enables dynamic imports in a node context.
Without the "type": "module" declaration, nodejs tries to import this package as a CommonJS module when using the dynamic import(), resulting in the error "Unexpected token 'export'".
Fixes #2303
Checks
- [x] I have read and followed the Contributing Guidelines.
:wave: Hello @slangreck! Please make sure to review the Contributing Guidelines to ensure your PR is compliant. Thank you!
@hodgef Any chance this is going to be merged?
Thanks guys, will check this out later tonight. Need to make sure it won't cause regressions for people bundling with Webpack
Yeah as I suspected the build has failed. Maybe I can edit the bundling config (target) for the layouts instead of adding "type": "module". Will look into it tonight.
[webpack-cli] Failed to load '/home/runner/work/simple-keyboard-layouts/simple-keyboard-layouts/webpack.config.js' config
[webpack-cli] ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and '/home/runner/work/simple-keyboard-layouts/simple-keyboard-layouts/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
Hi all, I've added the commonjs layouts in version 3.4.0 https://github.com/simple-keyboard/simple-keyboard-layouts/tree/master/build/commonjs/layouts
Regards, Francisco Hodge