🔷 Solid JS
🍣 Rollup
🧼 Babel + Typescript + ESLint + Prettier
📑 Jest
🔃 Routing
📴 PWA Powered
🖍 SCSS modules + assets resolution
🔠 Inline SVG
🛰 Native ES Modules with modulepreload
👨💻 CSS Modules assistance
git clone https://github.com/MrFoxPro/solid-rollup-boilerplate.git && npm i
run npm start
and open http://localhost:3000
run npm run build
to create optimized build
text from https://philipwalton.com/articles/using-native-javascript-modules-in-production-today/
If you’re already using a bundler like webpack, and you’re already using granular code splitting and preloading those files (similar to what I describe here), you might be wondering whether it’s worth switching to a strategy that uses real modules. Here are a few reasons why I think you should consider it, and why bundling to real modules is better than using classic scripts with their own module-loading code.
When using real modules, users on modern browsers don’t have to load any unnecessary module loading or dependency management code. For example the webpack runtime and manifest would not be needed at all if using real modules.
So regardless of how granularly you code-split your app, it’s more performant to load chunks using import statements and modulepreload than it is to load them via classic script tags and regular preload (especially if those tags are dynamically generated and added to the DOM at runtime).
In other words, a Rollup bundle consisting of 20 module chunks will load faster than the same code base bundled to 20 classic-script chunks with webpack (not because it’s webpack, but because it’s not real modules).
This boilerplate temporary uses fork of rollup-plugin-html2. Check this PR
Thanks to @high1 for jest configuration
Thanks to @philipwalton for great articles about native modules and simple rollup setup
Using Native ES Modules
Preloading modules
-
Split configuration for modern and legacy browsers.
This bolierplate is configured with @babel/preset-env to support Edge browser.
For more modern browsers you could completely remove preset-env and uncommentmanualChunks
in config -
Setup tests
-
Add build-time typechecking
-
Create true differential build for modern/legacy browsers
-
Add option to transpile Service Worker to CommonJS due to chromium bug