UNPKG

6.08 kBMarkdownView Raw
1Naming Rules
2===
3
4_bundle-folder = "/bundles"_
5_[[HASH]] = a unique hash string build from the concatenated bundles string_
6_[[COUNTER]] = if the same file exists (in one build), increase the counter_
7
8## without NPM
9### main bundle only
10| module | bundled path | note |
11|----------------------------------------------------------|------------------------------------------------------------------------|------------------------|
12| mymodule | `/bundles/mymodule.js` | |
13| mymodule.js | `/bundles/mymodule.js` | |
14| mymodule | `/bundles/mymodule.js` | |
15| deep/folder/structure/with/very/very-very-very-long-name | `/bundles/deep/folder/structure/with/very/very-very-very-long-name.js` | main bundles arent cut |
16| index.stache!done-autorender | `/bundles/index.js` | |
17
18### with bundles
19| module | bundled path | note |
20|-----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
21| | | |
22| `["main/bar", "bar/foo"]` | `/bundles/bar-foo.js` | |
23| `["main/my-very-long-name", "bar/eman-gnol-yrev-ym"]` | `/bundles/my-very-long-nam-[[HASH]].js` | [[HASH]] = a unique hash string, concat bundle[0] + bundle[1],cut to 25 chars |
24| `["main/my-very-long-name", "bar/eman-gnol-yrev-ym"]` | `/bundles/my-very-long-nam-[[HASH]]-[[COUNTER]].js` | [[HASH]] = a unique hash string; concat bundle[0] + bundle[1],cut to 25 chars; if the same file exists, put a counter var at the end |
25| `["deep/folder/structure/with/very/very-very-very-long-name","deep/space/nine/is/a/great-series/from-the-90s"]` | `/bundles/very-very-very-l-f802f7c2-[[HASH]].js` | [[HASH]] = a unique hash string; concat bundle[0] + bundle[1],cut to 25 chars |
26| `["main/bar0815.com.js", "bar/foo- bar"]` | `/bundles/bar0815-com-foo-bar.js` | for bundles, we only return filenames with chars, numbers, `-` and `_` | |
27
28
29## with NPM
30### main bundle only
31| module | bundled path | note |
32|---------------------------------------------- |---------------------------------- |------ |
33| myproject@1.0.0#bar | `/bundles/myproject/bar.js` | |
34| myproject@1.0.0#index.stache!done-autorender | `/bundles/myproject/index.js` | |
35| myproject@1.0.0#main!my-plugin | `/bundles/myproject/main.js` | |
36| myproject.com@1.0.0#main | `/bundles/myproject.com/main.js` | |
37
38### with bundles
39| module | bundled path | note |
40|------------------------------------------------------------ |----------------------------------- |------ |
41| `["pkg@1.0.0#component/my-component", "pkg@1.0.0#foobar"]` | `/bundles/my-component-foobar.js` | |
42| `["pkg@1.0.0#bar.js", "pkg@1.0.0#foo.js"]` | `/bundles/bar-foo.js` | |
43| `["pkg@1.0.0#main", "jquery@1.0.0#lib/index"]` | `/bundles/main-index.js` | |
44
45| prevent file collisions 1. | bundled path | note |
46| ---------------------------------------------------------- |----------------------------------- |------------------------------ |
47| `["pkg@1.0.0#foo", "pkg@1.0.0#bar"]` | `/bundles/foo-bar.js` | |
48| `["pkg@1.0.0#component/foo", "pkg@1.0.0#component/bar"]` | `/bundles/foo-bar-[[COUNTER]].js` | put a counter var at the end |
49
50| prevent file collisions 2. | bundled path | note |
51|----------------------------------------------------- |-------------------------------------- |------------------------------ |
52| `["pkg@1.0.0#main", "jquery@1.0.0#lib/index"]` | `/bundles/main-index.js` | |
53| `["otherpkg@1.0.0#main", "moment@1.0.0#lib/index"]` | `/bundles/main-index-[[COUNTER]].js` | put a counter var at the end |