Comments (3)
It's happening to support that library/index.js can be referenced as library.js. But it's not intended that library_index.js is transformed. Please do explore a fix!
from importmap-rails.
Ah, it does appear this is happening on purpose. I'm curious why? Should I rename my files?
importmap-rails/lib/importmap/map.rb
Line 144 in e0c1676
Looking at the rest of the repo it's not obvious as to why a file ending in index
should have that removed
from importmap-rails.
Breaking down the regex, it's scanning for:
\/?
← Matches one or zero/
charactersindex
← Matches the word index$
← Matches the end of a line
This is to try and match the following examples:
index.js
folder/index.js
But because it looks for 0 or 1 /
, it also picks up super_index.js
I'm going to put together a PR updating this regex to /(:\/|^)index$/
which broken down is:
(:
← Start non-capturing group\/
← Matches the/
character|
← OR operator^
← Matches the start of the string
)
← Close groupindex
← Matches the word index$
← Matches the end of a line
Which will still match
index.js
folder/index.js
but specifically won't matchsuper_index.js
because we're now require either the string to start or the character/
right before the wordindex
from importmap-rails.
Related Issues (20)
- asset_path('es-module-shims.min') does not work in production HOT 1
- Why do certain pins disappear in production? HOT 2
- Unpin command causing net error HOT 3
- Confusing message on 'update'
- Unable to unpin HOT 1
- Persistent 404 error when pinning HOT 11
- Package works when pinned from JSPM but not when downloaded HOT 2
- Break in iOS 16.2 when upgrading from 1.2.3 to 2.0.1 HOT 4
- turbo:load event not fired anymore in test environment after upgrade from 1.2.3 to 2.0.1 HOT 3
- Feature suggestion: optional `process.env` polyfill
- Multiple importmaps HOT 6
- Importmap update removes pins via http HOT 1
- importmap pin/update removes preload: false
- ga.jspm.io never updates HOT 3
- ./bin/importmap outdated command fails with undefined method `dig' for an instance of String HOT 6
- Add option to `bin/importmap pin URL` to create direct/remote link without downloading
- Option to 're-sync' vendor folder HOT 2
- How to add jquery in importmaps rails 7 HOT 2
- `update` does not update a package even when `outdated` shows the new version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from importmap-rails.