meteor-vue / vue-meteor

🌠 Vue first-class integration in Meteor
897 stars 111 forks source link

working with webpack? #158

Closed funkyLover closed 7 years ago

funkyLover commented 7 years ago

forgive me for opening this issue, actually, i haven't yet to try this project, just get some confuse, if this isn't the right way to put question, please close this issue without hesitation.

i work with a project with vue(with webpack) and meteor, like this repo dose, work fine but something make my mind a mess.

1) the origin process of front-end develop with meteor : edit client side code -> meteor build -> build done and make browser reload whole page. 2) when work with webpack, it becomes: edit client side code -> meteor build -> webpack build -> build done and make browser reload whole page

the font-end development still base on meteor build process. is it possible make that : edit client side code -> can hmr? -> yes, webpack build, and don't reload whole page -> no, webpack build, and reload whole page? just like front-end development without meteor! i need more scalability with front-end(i.e. code-splitting like webpack dose, custom app structure.....)

i have try vue-meteor-demo, and it work just like above! great work!vue-meteor dose not require webpack, can i integrate with webpack when i want(or need) to do.

funkyLover commented 7 years ago

another example vue-webpack-meteor-example.

just make: webpack watch -> client side build -> dist pubilc -> meteor build -> reload whole page. a simple trick but dosen't hlep.

Akryum commented 7 years ago

Using webpack is not necessary (nor recommended) with vue-meteor. It already provides most of the things you need (like HMR), and Meteor is getting code-splitting in the 1.5 release.

funkyLover commented 7 years ago

thank @Akryum !

gustawdaniel commented 6 years ago

Why using webpack is not recommended with vue-meteor?

And how to add configuration like this

      {
        test: /\.js$/,
        loader: 'babel-loader',
-       include: [resolve('src'), resolve('test')]
+       include: [
+         resolve('src'),
+         resolve('test'),
+         resolve('node_modules/vue-echarts'),
+         resolve('node_modules/resize-detector')
+       ]
      }

to file that in pure vue project is called build/webpack.base.conf.js

Question is inspired by README of

https://github.com/ecomfe/vue-echarts

but I have seen some other examples of vue packages that recommend some changes in webpack file.

gustawdaniel commented 6 years ago

I found solution in

https://github.com/meteor-vue/vue-meteor/issues/207

Instead of importing vue file

import ECharts from 'vue-echarts/components/ECharts'

We should import js file

import ECharts from 'vue-echarts/dist/vue-echarts'