Git Product home page Git Product logo

Comments (5)

CarGuo avatar CarGuo commented on May 21, 2024

看下面代码,虽然项目里没有 import Vue from 'vue'\n,但是事实上编译时加了

const getEntryFileContent = (source, routerpath) => {
  let dependence = `import Vue from 'vue'\n`;
  ······
const getEntryFile = () => {
  const entryFile = path.join(vueWebTemp, config.entryFilePath)
  const routerFile = path.join(vueWebTemp, config.routerFilePath)
  const storeFile = path.join(vueWebTemp, config.storeFilePath)
  fs.outputFileSync(entryFile, getEntryFileContent(helper.root(config.entryFilePath), routerFile));
  fs.outputFileSync(routerFile, getRouterFileContent(helper.root(config.routerFilePath)));
  fs.outputFileSync(storeFile, getRouterFileContent(helper.root(config.storeFilePath)));//他
  return {
    index: entryFile
  }
}

源文件
https://github.com/CarGuo/GSYGithubAppWeex/blob/46c253b48126ac5dba14bd8e0b08a8c50824e816/src/store.js
效果文件
https://github.com/CarGuo/GSYGithubAppWeex/blob/46c253b48126ac5dba14bd8e0b08a8c50824e816/.temp/store.js

from gsygithubappweex.

hong-xu avatar hong-xu commented on May 21, 2024

编译后的store.js是有import Vue的
image
但是项目运行的文件还是用的源文件

image

入口文件引的也是编译后的文件,还是报错我就是想不通哪里出了问题
image

from gsygithubappweex.

hong-xu avatar hong-xu commented on May 21, 2024

直接用你项目的配置也是不行,但是你的项目是可以,感觉是人品问题

from gsygithubappweex.

CarGuo avatar CarGuo commented on May 21, 2024

很明显你白色图里的打包进去的js代码里没有 vue

from gsygithubappweex.

hong-xu avatar hong-xu commented on May 21, 2024

就是没有啊就报错了,web环境下打包进去的还是store.js的源文件。并不是编译好的.temp里的store.js文件,但是删掉.temp文件夹里的store.js又会报错:没找到store.js。我是真的不知道哪里出了问题,先不纠结了,打包web运行的文件先自己手动加下import Vue 吧

from gsygithubappweex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.