-
Notifications
You must be signed in to change notification settings - Fork 62
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
Add entry point index.js #137
Comments
This type of import ( Creating an |
Well this way of importing ES6 modules seems to be working quite well at chesslablab.org without any transpilation at all. The importmap will probably be easier to maintain as both the shaack/cm-chessboard library and the chesslablab/website get more complex. <?php
return [
'js/layout/san/elems.js' => [
'path' => './assets/js/layout/san/elems.js',
'entrypoint' => true,
],
'js/layout/rav/elems.js' => [
'path' => './assets/js/layout/rav/elems.js',
'entrypoint' => true,
],
'@chesslablab/cmblab' => [
'version' => '0.0.1',
],
'@chesslablab/jsblab' => [
'version' => '0.1.3',
],
'bootstrap' => [
'version' => '5.3.2',
],
'bootstrap/dist/js/bootstrap.bundle.min.js' => [
'version' => '5.3.2',
],
'bootstrap/dist/css/bootstrap.min.css' => [
'version' => '5.3.2',
'type' => 'css',
],
'bootstrap/js/dist/modal.js' => [
'version' => '5.3.2',
],
'jwt-decode' => [
'version' => '4.0.0',
],
]; |
Also if I'm not very much mistaken, at the moment files need to be imported one by one as it is described at Importing Specific Files From a 3rd Party Package. |
Hi Jordi. I am talking about a javascript importmap, like https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap. This allows you to define on a page level where packages are found. It helps if your modules are spread around the project in I don't really see a problem with including multiple files, maybe because I come from the Java world where this is the normal way. But if it helps you a lot, I am thinking about merging the BTW I like your project, very nice and well coded. 👍 |
Hi there, probably it'd be a good idea to add the
src/index.js
file to allow importing any module similar to MUI as described in the example below.I'm currently using this approach to develop a bunch of chess utilities in the
chesslablab/jsblab
library which is by the way based onshaack/cm-chessboard
:The entry point
index.js
will be backward compatible for existing users.The text was updated successfully, but these errors were encountered: