Giter Site home page Giter Site logo

E:\git\my-vue-scaffold\node_modules\memory-fs\lib\MemoryFileSystem.js:114 throw new MemoryFileSystemError(errors.code.ENOENT, _path); ^ Error: no such file or directory about vue-skeleton-webpack-plugin HOT 10 CLOSED

lavas-project avatar lavas-project commented on May 29, 2024
E:\git\my-vue-scaffold\node_modules\memory-fs\lib\MemoryFileSystem.js:114 throw new MemoryFileSystemError(errors.code.ENOENT, _path); ^ Error: no such file or directory

from vue-skeleton-webpack-plugin.

Comments (10)

xiaobinwu avatar xiaobinwu commented on May 29, 2024

srr.js 文件 var serverCompiler = webpack(serverWebpackConfig, (err, stats) => { if (err || stats.hasErrors()) { console.log(err) } console.log('success') });
打印出来的是success

bundle也能获取得到

node -v
v6.11.3

npm -v
3.10.10

from vue-skeleton-webpack-plugin.

xiaobinwu avatar xiaobinwu commented on May 29, 2024

webpack.skeleton.config.js

const { resolve } = require('path')
const nodeExternals = require('webpack-node-externals')
const ExtractTextPlugin = require("extract-text-webpack-plugin")
const glob = require('glob')
const entryJsList = {}
const entries = glob.sync('./src/skeleton/*/entry-skeleton.js')
for (const path of entries) {
const chunkName = path.slice('./src/skeleton/'.length, -'/entry-skeleton.js'.length)
entryJsList[chunkName] = resolve(__dirname, path)
}

console.log(entryJsList)

module.exports = {
target: 'node',
devtool: false,
entry: entryJsList,
output: {
path: resolve(__dirname, 'dist'),
filename: 'static/js/[name].js',
libraryTarget: 'commonjs2'
},
resolve: {
extensions: ['.js', '.json', '.vue'],
alias: {
'~': resolve(__dirname, 'src'),
vue$: 'vue/dist/vue.esm.js'
}
},
module: {
rules: [
{
enforce: 'pre',
test: /.vue$/,
loader: 'eslint-loader',
exclude: /node_modules/
},
{
test: /.js$/,
exclude: /node_modules/,
use: ['babel-loader', 'eslint-loader']
},
{
test: /.vue$/,
loader: 'vue-loader',
options: {
loaders: {
sass: ExtractTextPlugin.extract({
use: 'css-loader!sass-loader',
fallback: 'vue-style-loader'
})
}
}
}
]
},
externals: nodeExternals({
whitelist: /.css$/
}),
plugins: []
}

from vue-skeleton-webpack-plugin.

xiaobinwu avatar xiaobinwu commented on May 29, 2024

解决了呢

from vue-skeleton-webpack-plugin.

xiaoiver avatar xiaoiver commented on May 29, 2024

CSS 样式文件是用 ExtractWebpackPlugin 从 JS 里提取出来的。而这个插件根据 Webpack 宿主环境 2.x或者3.x 也有两个对应的版本 2.x.x 和 3.x.x。
所以我们这个插件也需要根据项目的 Webpack 版本选择 0.x.x(Webpack 2) 或者 1.x.x(Webpack 3)。

否则可能存在以下的问题:
原项目已经安装了 2.x.x 的 ExtractWebpackPlugin,而安装这个插件时又安装了 3.x.x 的ExtractWebpackPlugin。这样两个版本的依赖同时存在,从 MemoryFS 里就找不着样式文件了。

不过这是插件早期存在的问题,现在通过 package.json 的 peerDependencies,安装插件时发现不匹配是会在控制台给出提示的。

from vue-skeleton-webpack-plugin.

jiangjunfeng98 avatar jiangjunfeng98 commented on May 29, 2024

@xiaobinwu 我也遇到一样的问题了,你怎么解决的呢? 按照作者给出的提示没搞定

from vue-skeleton-webpack-plugin.

huangyingwen avatar huangyingwen commented on May 29, 2024

按照作者提示,还是没有搞定
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

from vue-skeleton-webpack-plugin.

huangyingwen avatar huangyingwen commented on May 29, 2024

这个问题已经解决了,如果用 vue-cli 模板配置,注意把 vue-loader.conf.js 修改下,启用
ExtractTextPlugin


const utils = require('./utils')
const config = require('../config')
const isProduction = process.env.NODE_ENV === 'production'

module.exports = {
  loaders: utils.cssLoaders({
    sourceMap: isProduction
      ? config.build.productionSourceMap
      : config.dev.cssSourceMap,
    // extract: isProduction
    extract: true
  }),
  transformToRequire: {
    video: 'src',
    source: 'src',
    img: 'src',
    image: 'xlink:href'
  }
}

from vue-skeleton-webpack-plugin.

huangyingwen avatar huangyingwen commented on May 29, 2024

基于 vue-cli 配置,skeleton 会一闪而过,不知道什么原因

from vue-skeleton-webpack-plugin.

huangyingwen avatar huangyingwen commented on May 29, 2024

我知道什么原因了,服务渲染挂载需要修改

/* eslint-disable no-new */
// new Vue({
//   el: '#app',
//   router,
//   store,
//   loading,
//   template: '<App/>',
//   components: {
//     App
//   }
// })

let app = new Vue({
  router,
  store,
  loading,
  ...App
})

router.onReady(() => {
  store.commit('iniIsandroid')
  store.commit('initClientHeight')
  app.$mount('#app')
})

from vue-skeleton-webpack-plugin.

huangyingwen avatar huangyingwen commented on May 29, 2024

@jiangjunfeng98 把 vue-loader.conf.js 修改下,我上面已经回复了

from vue-skeleton-webpack-plugin.

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.