webpack-glob-entries | small function which allows you to pass glob
kandi X-RAY | webpack-glob-entries Summary
kandi X-RAY | webpack-glob-entries Summary
A small function which allows you to pass glob to generate entries hash object
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of webpack-glob-entries
webpack-glob-entries Key Features
webpack-glob-entries Examples and Code Snippets
Community Discussions
Trending Discussions on webpack-glob-entries
QUESTION
I have a webpack config that is based off https://github.com/vuejs-templates/webpack-simple/blob/master/template/webpack.config.js It uses vue-loader and babel-loader. The issue is I cannot get it to generate ES5 code so that it will work in the most broad range of clients.
If I use the ES2015 preset, webpack.optimize.UglifyJsPlugin
fails to minify the output because Uglify can only handle ES5 (not counting the harmony branch). The errors are similar to: Unexpected token: punc (()
and occur in multiple files.
I can work around this by using babili-webpack-plugin
which will minify the ES6 code but is very slow. However, when I deploy this code, I see errors being reported back saying Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
so I know they are older clients choking on ES6 code.
How can I get proper ES5 code output from babel-loader? I have tried multiple presets, with or without the transform-runtime
plugin. Config below:
ANSWER
Answered 2017-Aug-14 at 13:12vue-loader
will process your js
with babel-loader
(if it's detected), and uses .babelrc
by default.
In your current setup you are not passing any options to Babel when it is used by vue-loader
(meaning Babel uses no rules for your Vue files).
Either create .babelrc
or specify the js
loader by yourself for the .vue
files to provide it with options:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install webpack-glob-entries
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page