"modern" mode
See original GitHub issueInspired by Meteor 1.7 and the fact that you can easily ship ES2015 code and legacy code side-by-side, we can enable a mode where Vue CLI produces two bundles: one for legacy browsers using the specified browserslist
values, and one that targets only browsers that support <script type="module">
.
babel-preset-env
supportstargets: { esmodules: true }
which allows us to easily target these modern browsers.- We can likely extract the corresponding browsers list for autoprefixer as well.
This should allow Vue CLI users to ship a significantly smaller, and decently more performant bundle to a large percentage of end users. In Vue 2.6 we can also add a build of Vue that ships native ES2015, which can be used in this mode.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:49
- Comments:12 (5 by maintainers)
Top Results From Across the Web
MODERN MODE
Home · About Us · Products + -. MODERN MODE CAFÉ · MODERN MODE SELECT · MODERN MODE GOODS · Menu · 登入...
Read more >MM
browse our vast inventory of vintage and new items. Specializing in danish modern, eames, knoll and herman miller. MM_New hours 5-18.jpg. Mode Moderne....
Read more >Modern mode store - Instagram
12.2k Followers, 5274 Following, 188 Posts - See Instagram photos and videos from Modern mode store (@modern_mode.store)
Read more >Mode Moderne - Philadelphia, PA 19106 - 1stDibs
Mode Moderne is located in Philadelphia's historic Old City. ... Vintage 1970s American Mid-Century Modern Lounge Chairs. Materials.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh, so you changed the browserslist and applied the
--modern
flag?changing the browserslist to cover only modern browsers will make webpack build a bundle that contains only modern mode without the
--modern
flag.And any additional “trickery” that “modern mode” does, i.e. changing the modern bundle’s
<script>
elements totype="module"
are not necessary as that’s just a way to make the two bundles work side-by-side - which you don’t want or need.@ttodua it’s been a while since your question, but here is the extensive explanation: https://github.com/browserslist/browserslist#browserslistrc
TL;DR: each row is connected with an OR, therefore, "build for every browser version which has >1% market share OR the last 2 versions of a browser OR is not IE version <= 8.
I changed my file to be
This results in Vue CLI building only for modern browsers.