Comments (7)
Can you provide more details on how you change the code, or a repo.
npm i -S jquery
and import $ from 'jquery'
just works for me.
from vuepack.
Sorry, my bad, i had not fresh source.
What is creating this issue is module googlemaps-js-rich-marker
. It is enough that this module is installed (don't have to be imported) for this issue to arise: npm i -S googlemaps-js-rich-marker
So now it is maybe not vuepack's failure. Could you guide me how to solve this? I am new to whole webpack/bundling/etc.
Thanks.
from vuepack.
Ok, seems googlemaps-js-rich-marker
needs to be compiled to es5
It failed because that package is written in ES6 and uglifyjs
doesn't understand ES6 syntax, and we do not compile files in node_modules
folder by default.
Why it failed even if you didn't import googlemaps-js-rich-marker
Since vuepack splits all dependencies
specified in package.json
into a single vendor.xxx.js
, googlemaps-js-rich-marker
will always be compiled by webpack and bundled into vendor.xxx.js
How to fix
You should make babel-loader
compile it to ES5. Checkout webpack.base.js.
By default it excludes node_modules
and does not handle .es6
extension which that module uses, so the fix for you will be:
{
test: /\.(js|es6)$/,
loaders: ['babel'],
// compile your app directory and some modules
include: [/client/, /node_modules\/googlemaps-js-rich-marker/]
}
from vuepack.
Thank you for detailed explanation, now I understand.
For the loaders
part, wouldn't this be sufficient? Does it have any disadvantages?
{
test: /\.js$/,
loaders: ['babel'],
exclude: [/node_modules/]
},
{
test: /\.es6$/,
loaders: ['babel']
}
from vuepack.
Maybe yours is better. .es6
should always be compiled to ES5
from vuepack.
Great, don't you think this could be part od vuepack by default?
from vuepack.
Updated 👏
from vuepack.
Related Issues (20)
- Missed packages HOT 5
- Is it possible to proxy requests to backend with dev server? HOT 3
- [Suggestion] Add babel-polyfill to the project HOT 1
- i create project npm run app electron empty.!! HOT 3
- Base project prod build packs up entire project folder HOT 3
- App crashed after deployed on Heroku. But it's working in my local. HOT 17
- How to configure ES7 support? HOT 1
- Node version 8.4 Support HOT 1
- `htmlWebpackPlugin is not defined` error during initialization HOT 1
- Unit tests configurations
- dynamic import in vue-router css and less file is not loaded
- HOT Reload is not working HOT 3
- Norton says that your site uses a coin miner HOT 1
- Docker deployment image HOT 1
- Switch to Parcel HOT 2
- [question] Why is localhost:4000 showing only a blank page?
- Vue-router: History Mode - Built app blank on public subdirectory
- IE 11 support?
- I have this problem with heroku and my discord bot it dont go online HOT 1
- Vuepack 4.0 progress
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vuepack.