airyland / vux-loader

hack into vue-loader
64 stars 37 forks source link

index.js?102c:3 VUX: 如果你看到这一行,说明 vux-loader 配置有问题或者代码书写规范的原因导致无法解析成按需引入组件,会导致打包体积过大。请升级到最新版本 vux-loader,建议开启 eslint(standard)。 #19

Closed Jiiiiiin closed 7 years ago

Jiiiiiin commented 7 years ago

更新代码之后index.js?102c:3 VUX: 如果你看到这一行,说明 vux-loader 配置有问题或者代码书写规范的原因导致无法解析成按需引入组件,会导致打包体积过大。请升级到最新版本 vux-loader,建议开启 eslint(standard)。 配置了: ` const vuxLoader = require('vux-loader') var webpackConfig = require('./webpack.base.conf.js')

module.exports = vuxLoader.merge(webpackConfig, { plugins: [ { name: 'vux-ui' }, { name: 'script-parser', fn: function (source) { return source.replace('VARIABLE', 'v2') } }, { name: 'style-parser', fn: function (source) { return source.replace('black', 'white') } }, { name: 'js-parser', fn: function (source) { return source.replace('black', 'white') } }, // css 重复代码清除, 在webpack 构建完成后对生成的css文件使用cssnano进行重复样式清除。建议只在production环境下开启,因为dev环境没有必要。 { name: 'duplicate-style', events: { done: function () { console.log('done!') } } }, { name: 'build-done-callback', fn: function () { console.log('done!') } } ] })

无解,目前版本: "dependencies": { "axios": "^0.16.2", "babel-runtime": "^6.23.0", "fastclick": "^1.0.6", "good-storage": "^1.0.1", "stylus": "^0.54.5", "stylus-loader": "^3.0.1", "vplus": "^0.1.17", "vue": "^2.3.4", "vue-lazyload": "^1.0.5", "vue-router": "^2.3.1", "vuerify": "^0.4.0", "vuex": "^2.3.1", "vux": "^2.4.0" }, "devDependencies": { "autoprefixer": "^6.7.2", "babel-core": "^6.22.1", "babel-eslint": "^7.1.1", "babel-loader": "^6.2.10", "babel-plugin-transform-function-bind": "^6.22.0", "babel-plugin-transform-runtime": "^6.22.0", "babel-polyfill": "^6.23.0", "babel-preset-env": "^1.3.2", "babel-preset-stage-2": "^6.22.0", "babel-register": "^6.22.0", "chalk": "^1.1.3", "connect-history-api-fallback": "^1.3.0", "copy-webpack-plugin": "^4.0.1", "css-loader": "^0.28.0", "eslint": "^3.19.0", "eslint-config-standard": "^6.2.1", "eslint-friendly-formatter": "^2.0.7", "eslint-loader": "^1.7.1", "eslint-plugin-html": "^2.0.0", "eslint-plugin-promise": "^3.4.0", "eslint-plugin-standard": "^2.0.1", "eventsource-polyfill": "^0.9.6", "express": "^4.14.1", "extract-text-webpack-plugin": "^2.0.0", "file-loader": "^0.11.1", "friendly-errors-webpack-plugin": "^1.1.3", "html-webpack-plugin": "^2.28.0", "http-proxy-middleware": "^0.17.3", "less": "^2.7.2", "less-loader": "^4.0.4", "opn": "^4.0.2", "optimize-css-assets-webpack-plugin": "^1.3.0", "ora": "^1.2.0", "rimraf": "^2.6.0", "semver": "^5.3.0", "shelljs": "^0.7.6", "url-loader": "^0.5.8", "vue-loader": "^12.2.1", "vue-style-loader": "^3.0.1", "vue-template-compiler": "^2.3.3", "vux-loader": "^1.0.68", "webpack": "^2.6.1", "webpack-bundle-analyzer": "^2.2.1", "webpack-dev-middleware": "^1.10.0", "webpack-hot-middleware": "^2.18.0", "webpack-merge": "^4.1.0" }, `

请指教!

airyland commented 7 years ago

升级到 vux-loader@1.1.0。

Jiiiiiin commented 7 years ago

@airyland 谢谢!感谢作者的坚持!

songyazhao commented 6 years ago

我遇到了一个同样的问题

万般排除之后, 发现将下面代码第5行, 后面的注释删掉就没事了, 是BUG吗?

src/main.js

import Vue from 'vue';
import VueRouter from 'vue-router';
import FastClick from 'fastclick';
import App from './App';
import store from './store'; // 这里加上注释就会出现那个提示
import { ToastPlugin, AjaxPlugin, ConfirmPlugin } from 'vux';

Vue.use(VueRouter)

FastClick.attach(document.body)

const router = new VueRouter({
  routes: [{
    name: 'Home',
    path: '/',
    component: () => import('@/pages/Index'),
    meta: {
      title: '驾遇汽车服务'
    }
  }]
})

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app-box')
airyland commented 6 years ago

@songyazhao 可能是,有时间再排查下。

Jiiiiiin commented 6 years ago

@songyazhao 👍 哈哈