3 ms·
One thing that really sours me in esm is that this is possible (fictional main.js): import Vue from 'vue' import jQuery from 'jquery' global.jQuery
by crescentfresh 8y ago
One thing that really sours me in esm is that this is possible (fictional main.js):
import Vue from 'vue'
import jQuery from 'jquery'
global.jQuery = jQuery // to get the next line to
work
import Bootstrap from 'bootstrap'
import 'bootstrap/dist/css/bootstrap.css'
Then my head explodes. Why would importing a .css file from my JavaScript ever be a thing supported by any tooling. What is that line trying to communicate? What does it even mean to my current scope? (hint: nothing)
import became a giant "do something cool on this line" that maybe the tooling you're using knows how to translate via (say) a webpack loader.
For anyone wondering, that line gets translated to the browser dynamically including css on the page.
- spankalee 8y agoImporting CSS is not supported, at least yet.