Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于编译生成js的疑问 #6

Closed
hayvane opened this issue Feb 21, 2017 · 7 comments
Closed

关于编译生成js的疑问 #6

hayvane opened this issue Feb 21, 2017 · 7 comments

Comments

@hayvane
Copy link

hayvane commented Feb 21, 2017

1.通过npm run dev 生成的 js 文件在哪里?(native 端)
2.如果我有多个vue, 想生成多个js 如何配置?

@csvwolf
Copy link
Contributor

csvwolf commented Mar 9, 2017

@QingWei-Li

@duke-lv
Copy link

duke-lv commented Mar 10, 2017

@hayvane run dev 是在内存跑的吧,只有build才是生成的打包文件。

@hayvane
Copy link
Author

hayvane commented Mar 20, 2017

是的,我的意思是生成多个.js 文件,一个vue文件对应生成一个js文件。
这个我自己改好了,关了吧。

@py389172739
Copy link

@hayvane 请问你生成多个js怎么弄的?webpack怎么配置的,我弄了半天都没弄好,我也是做native开发的

@snowons
Copy link

snowons commented Apr 18, 2017

@py389172739 改写你的webpack.config.js 中的entry,指定多个就可以了
eg:

function getBaseConfig () {
  return {
    entry: {
      'XXXA': path.join(__dirname, 'src', 'your-a.vue?entry=true'),
      'XXXBl': path.join(__dirname, 'src', 'your-b.vue?entry=true')
    },
    output: {
      path: 'dist/bundlejs/',
      filename: '[name].js'
    },
......
.....
}

@csvwolf csvwolf closed this as completed May 9, 2017
@nothing-important
Copy link

@hayvane 请问你是怎么生成.vue对应的.js的文件呢?

@hayvane
Copy link
Author

hayvane commented Apr 17, 2019

@hayvane 请问你是怎么生成.vue对应的.js的文件呢?

见上文snowons给出的配置

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants