Code Monkey home page Code Monkey logo

element-starter's Introduction

element-starter

A starter kit for Element UI generated by vue-cli

If you are familiar with cooking, here is a starter generated with it

Environment

Node >= 6

Start

  • Clone or download this repository
  • Enter your local directory, and install dependencies:
yarn

Develop

# serve with hot reload at localhost:8010
npm run dev

Build

# build for production with minification
npm run build

element-starter's People

Contributors

alexandesigner avatar caihongyun avatar dear-lizhihua avatar leopoldthecoder avatar pi0 avatar pipejesus avatar qingwei-li avatar ryantd avatar songhuagao avatar watano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

element-starter's Issues

不支持的配置写法

如下代码写法会在我的环境报错,是我的nodejs需要升级到某个版本才可以吗?

我的Node 版本v5.1.1, Npm版本3.3.12

// webpack.config.js
const {
  resolve
} = require('path')

错误内容:

(function (exports, require, module, __filename, __dirname) { const {
                                                                    ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:404:25)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at requireConfig (/Users/yhostc/Wechat/element-starter/node_modules/.2.2.0-rc.4@webpack/bin/convert-argv.js:96:18)
    at /Users/yhostc/Wechat/element-starter/node_modules/.2.2.0-rc.4@webpack/bin/convert-argv.js:109:17
    at Array.forEach (native)

How to use date picker component in the form of render function?

For some reasons, I have to use component in the form of render function,
What's the equivalent of this:

    <el-date-picker
      v-model="value1"
      type="datetime"
      placeholder="选择日期时间">
    </el-date-picker>

I've tried below but only type and placeholder worked. when I select a datetime, the value doesn't change.

// in render function
var self = this
h('el-date-picker',{
        attrs: {type:'datetime', placeholder: "选择日期时间"}, 
        domProps: {value: self.value1},
        on: {change:  function(event) {self.value1=event.target.value}}
      })

error when using vue-i18n with elementUI

I EXACTLY followed the code on the site of elementUI ,the webpack compiler is ok, but in the browser, there is error, then I tried to import the vue-i18n in this element-starter project, still failed. And the version of vue-i18n is @6.x

Unused dependencies on package.json

There are a few unused dependencies on package.json:

  • babel-eslint
  • eslint
  • eslint-config-enough
  • eslint-loader

Also, some dependencies are outdated, for example vue and element-ui

断点定位不准,修改devtool不生效

由于webpack2 有这么一个问题(也可能是chrome的):Source Maps don't work on Chrome,目前把devtool设为#source-map 断点才能准确定位,但是目前无论怎么修改 webpack.config.js 中的 devtool, 在开发时始终都是 #eval-source-map 的模式。经测试发现原因是 package.json 中是如下配置的:

"dev": "webpack-dev-server -d --inline --hot --env.dev"

-d 这个参数似乎覆盖了 devtool 的配置,删掉这个参数后,devtool 配置才能生效。

history模式刷新404

historyApiFallback配置好像不生效,在vue-router的history模式下,怎么配都是刷新就没了,正常访问没问题,看了webpack-dev-server的文档,好像配置也没什么问题,不知道哪里出了问题

npm run dev failure

4 c4a8zxfm g fwerjeg41

but it works well in other computer with same versions of NPM & NODE, (win7)

Build Failed when npm run build

When execute "npm run build", the webpack throw a error.

ERROR in index.js?74362200ea0bc218cad7 from UglifyJs
Unexpected token: punc (() [index.js?74362200ea0bc218cad7:512,6]

ERROR in vendor.js?f0e7a8ae26abe932fe28 from UglifyJs
TypeError: Cannot read property 'sections' of null
    at new SourceMapConsumer (/Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/source-map/lib/source-map-consumer.js:20:19)
    at filterdFiles.forEach (/Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/webpack/lib/optimize/UglifyJsPlugin.js:61:20)
    at Array.forEach (native)
    at Compilation.compilation.plugin (/Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/webpack/lib/optimize/UglifyJsPlugin.js:40:18)
    at next (/Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/tapable/lib/Tapable.js:140:14)
    at Compilation.compilation.plugin (/Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/webpack/lib/optimize/UglifyJsPlugin.js:230:5)
    at Compilation.applyPluginsAsyncSeries (/Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/tapable/lib/Tapable.js:142:13)
    at self.applyPluginsAsync.err (/Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/webpack/lib/Compilation.js:635:10)
    at next (/Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/tapable/lib/Tapable.js:138:11)
    at Compilation.compilation.plugin.callback (/Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/webpack/lib/ProgressPlugin.js:113:6)
    at Compilation.applyPluginsAsyncSeries (/Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/tapable/lib/Tapable.js:142:13)
    at sealPart2 (/Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/webpack/lib/Compilation.js:631:9)
    at next (/Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/tapable/lib/Tapable.js:138:11)
    at Compilation.compilation.plugin (/Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/webpack/lib/ProgressPlugin.js:109:6)
    at Compilation.applyPluginsAsyncSeries (/Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/tapable/lib/Tapable.js:142:13)
    at Compilation.seal (/Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/webpack/lib/Compilation.js:579:8)
    at /Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/webpack/lib/Compiler.js:493:16
    at /Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/tapable/lib/Tapable.js:225:11
    at _addModuleChain (/Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/webpack/lib/Compilation.js:481:11)
    at processModuleDependencies.err (/Users/zhangtao/SourceCode/FrontProject/SakersVue/node_modules/webpack/lib/Compilation.js:452:13)
    at _combinedTickCallback (internal/process/next_tick.js:95:7)
    at process._tickCallback (internal/process/next_tick.js:161:9)

If run dev, there will be OK. Below is my webpack.config.js for your reference.

const resolve = require('path').resolve
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const url = require('url')
const publicPath = ''
const env = process.env.NODE_ENV || 'development';
const shadow_url = process.env.SHADOW_URL;

module.exports = (options = {}) => ({
    entry: {
        vendor: './src/vendor',
        index: './src/main.js'
    },
    output: {
        path: resolve(__dirname, 'dist'),
        filename: options.dev ? '[name].js' : '[name].js?[chunkhash]',
        chunkFilename: '[id].js?[chunkhash]',
        publicPath: options.dev ? '/assets/' : publicPath
    },
    module: {
        rules: [{
                test: /\.vue$/,
                use: ['vue-loader']
            },
            {
                test: /\.js$/,
                use: ['babel-loader'],
                exclude: /node_modules/
            },
            {
                test: /\.css$/,
                use: ['style-loader', 'css-loader', 'postcss-loader']
            },
            {
                test: /\.(png|jpg|jpeg|gif|eot|ttf|woff|woff2|svg|svgz)(\?.+)?$/,
                use: [{
                    loader: 'url-loader',
                    options: {
                        limit: 10000
                    }
                }]
            }
        ]
    },
    plugins: [
        new webpack.optimize.CommonsChunkPlugin({
            names: ['vendor', 'manifest']
        }),
        new HtmlWebpackPlugin({
            template: 'src/index.html'
        }),
        new webpack.DefinePlugin({
            'process.env': {
                NODE_ENV: JSON.stringify(env),
                SHADOW_URL: JSON.stringify(shadow_url),
                SHADOW_API_PROXY: '/proxy/'
            }
        }),
        new webpack.optimize.UglifyJsPlugin({
            compress: {
                warnings: false
            }
        })
    ],
    resolve: {
        alias: {
            '~': resolve(__dirname, 'src'),
            'vue': 'vue/dist/vue.js'
        }
    },
    devServer: {
        host: '127.0.0.1',
        port: 8010,
        proxy: {
            '/api/': {
                target: 'http://127.0.0.1:8080',
                changeOrigin: true,
                pathRewrite: {
                    '^/api': ''
                }
            }
        },
        historyApiFallback: {
            index: url.parse(options.dev ? '/assets/' : publicPath).pathname
        }
    },
    devtool: options.dev ? '#eval-source-map' : '#source-map'
})

Uncaught TypeError: Cannot read property 'prototype' of undefined

This is my codes:

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Practise84</title>
	<!-- 引入样式 -->
	<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-default/index.css">
	<!-- 引入组件库 -->
	<script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>

<body>
	<el-tree
  :data="data2"
  show-checkbox
  default-expand-all
  node-key="id"
  ref="tree"
  highlight-current
  :props="defaultProps">
</el-tree>

<div class="buttons">
  <el-button @click="getCheckedNodes">通过 node 获取</el-button>
  <el-button @click="getCheckedKeys">通过 key 获取</el-button>
  <el-button @click="setCheckedNodes">通过 node 设置</el-button>
  <el-button @click="setCheckedKeys">通过 key 设置</el-button>
  <el-button @click="resetChecked">清空</el-button>
</div>


</body>

  <!-- 先引入 Vue -->
  <script src="http://apps.bdimg.com/libs/vue/1.0.14/vue.js"></script>
  <!-- 引入组件库 -->
  <script src="https://unpkg.com/element-ui/lib/index.js"></script>
  <script type="text/javascript" src="scripts/practise84.js"></script>
</html>

then the chrome report that:

Uncaught TypeError: Cannot read property 'prototype' of undefined
    at Object.e.__esModule.default (unpkg.com/[email protected]/lib/index.js:2)
    at t (unpkg.com/[email protected]/lib/index.js:1)
    at Object.e.__esModule.default (unpkg.com/[email protected]/lib/index.js:2)
    at t (unpkg.com/[email protected]/lib/index.js:1)
    at Object.e.__esModule.default (unpkg.com/[email protected]/lib/index.js:2)
    at t (unpkg.com/[email protected]/lib/index.js:1)
    at Object.e.__esModule.default (unpkg.com/[email protected]/lib/index.js:2)
    at t (unpkg.com/[email protected]/lib/index.js:1)
    at Object.e.__esModule.default (unpkg.com/[email protected]/lib/index.js:2)
    at t (unpkg.com/[email protected]/lib/index.js:1)
vue.js:9511 Download the Vue Devtools for a better development experience:
https://github.com/vuejs/vue-devtools
practise84.js:1 Uncaught SyntaxError: Unexpected token export

绑定失效,不能传递值

在使用组件时,如 ,el-transfer 组件无法获取父亲组件props传递的value1和data的值。组件可以编译出来,但是值传递不了

npm run build 错误

运行错误信息如下:
ERROR in build.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [build.js:35428,13]

chrome浏览器中无法找到menu item 的module

在该例子中的App.vue 中使用 el-menu(导航栏横栏的那个示例程序)时,第一次页面是可以刷出的,但是之后页面一直刷不出来,报错:
.//babel-loader/lib!.//vue-loader/lib/selector.js?type=script&index=0!./src/App.vue
Module not found: Error: Can't resolve '../node_modules/element-ui/packages/menu/src/menu-item' in '/Users/xujian/Workspace/element-starter/src'
@ .//babel-loader/lib!.//vue-loader/lib/selector.js?type=script&index=0!./src/App.vue 27:0-80
@ ./src/App.vue
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://127.0.0.1:8010 webpack/hot/dev-server ./src/main.js

DatePicker组件传递事件问题

代码如下:
父组件

<el-col :span="4">
            <time-picker v-on:pick="handlePick" ref="timePicker"></time-picker>
</el-col>

子组件是DatePicker的官方demo代码

我希望子组件选中时触发的emit事件(提问1 每次选中都会触发emit事件对吗?)
在父组件中能够被监听及处理
我在父组件中

 mounted: function() {
        this.$refs.timePicker.$on('pick',(value) => {console.log(+value)});
}

发现使用$on好像监听不到子组件的选中事件和值?不知道是不是打开方式不对

npm run

Error when rendering component : 报错,不知道为什么导致的呢

npm run dev: Vue packages version mismatch

按照README里面运行yarn, npm run dev之后报错:

ERROR in ./src/App.vue
Module build failed: Error: 

Vue packages version mismatch:

- [email protected]
- [email protected]

然后我自行修改pakcage.json中的

  "devDependencies": {
    "vue-template-compiler": "^2.5.2",
  }

从"^2.5.2"改到"^2.5.16"。没有报错了。

yarn version: 1.3.2
npm version: 5.7.1

我不熟悉node.js。不知道是什么原因。。。

关于element的导航如何进行路由

研究了20来分钟,真的觉得element的说明文档很难懂。
好吧,我就用例子说明element的导航怎么不在不适用进行路由
(1)在el-menu这个标签的属性中添加 router ,官方文档的解释是:启用vue-router 这种模式
(2)在el-menu-item标签中的index属性直接书写的路由,就可以实现正常vue-router了哈

<el-menu default-active="2" router class="menu" @open="handleOpen" @close="handleClose">
<el-menu-item index="/mainPage/zhecai"><i class="el-icon-star-on"></i>脆爽浙菜</el-menu-item>

我写的例子大家可以参考:https://github.com/yuanyuanshen/element-demo

npm run dev时报错

我的系统是deepin15.3,自己有一个搬瓦工的centos6.5的服务器,在(sudo) npm run dev 时都报错,又下了淘宝的cnpm也是报这个错,端口改过之后无效,node也没启动过。同事的mac和win7都没问题。是还需要什么配置吗?网上也没搜到别人碰到过这种问题

element-starter@ dev /var/www/element-starter-master
webpack-dev-server --inline --hot --env.dev

Project is running at http://127.0.0.1:10101/
webpack output is served from /assets/
404s will fallback to /assets/
events.js:182
throw er; // Unhandled 'error' event
^

Error: listen EADDRINUSE 127.0.0.1:10101
at Object._errnoException (util.js:1041:11)
at _exceptionWithHostPort (util.js:1064:20)
at Server.setupListenHandle [as _listen2] (net.js:1322:14)
at listenInCluster (net.js:1370:12)
at doListen (net.js:1492:7)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:611:11)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:598:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! element-starter@ dev: webpack-dev-server --inline --hot --env.dev
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the element-starter@ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/itzj00100/.npm/_logs/2017-09-18T13_00_19_265Z-debug.log

打包文件过大有什么解决方法?

打包文件过大有什么解决方法?
百度到vue-cli可以:

设置config文件夹index.js中productionSourceMap的值为false,也就是设置webpack配置中devtool为false,打包后文件体积可以减少百分之八十!!!!!!!

但在本项目模板都知道填哪里,能指导下??

Yarn not install

Using yarn can not install dependency when clone this repository.

but, using cnpm install or npm install it worked

Error when installing

There is an error in the webpack config.
I was able to get around it by changing the following lines.

module.exports = (options = {}) => ({

to

const options = {}
module.exports = {

and

filename: options.dev ? '[name].js' : '[name].js?[chunkhash]',

to

filename: options.dev ? '[name].js' : '[name].js?[hash]',

The error:

element-starter@ dev /Users/nwinner/Documents/personal/vuejs/element-starter
webpack-dev-server --inline --hot --env.dev

/Users/nwinner/Documents/personal/vuejs/element-starter/webpack.config.js:7
module.exports = (options = {}) => ({
^

SyntaxError: Unexpected token =
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:404:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at requireConfig (/Users/nwinner/Documents/personal/vuejs/element-starter/node_modules/webpack/bin/convert-argv.js:96:18)
at /Users/nwinner/Documents/personal/vuejs/element-starter/node_modules/webpack/bin/convert-argv.js:109:17
at Array.forEach (native)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! element-starter@ dev: webpack-dev-server --inline --hot --env.dev
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the element-starter@ dev script 'webpack-dev-server --inline --hot --env.dev'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the element-starter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack-dev-server --inline --hot --env.dev
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs element-starter
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls element-starter
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/nwinner/.npm/_logs/2017-05-04T19_48_35_360Z-debug.log

The log file from error:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'dev' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle element-starter@~predev: element-starter@
6 silly lifecycle element-starter@~predev: no script for predev, continuing
7 info lifecycle element-starter@~dev: element-starter@
8 verbose lifecycle element-starter@~dev: unsafe-perm in lifecycle true
9 verbose lifecycle element-starter@~dev: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/nwinner/Documents/personal/vuejs/element-starter/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
10 verbose lifecycle element-starter@~dev: CWD: /Users/nwinner/Documents/personal/vuejs/element-starter
11 silly lifecycle element-starter@~dev: Args: [ '-c', 'webpack-dev-server --inline --hot --env.dev' ]
12 silly lifecycle element-starter@~dev: Returned: code: 1 signal: null
13 info lifecycle element-starter@~dev: Failed to exec dev script
14 verbose stack Error: element-starter@ dev: webpack-dev-server --inline --hot --env.dev
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at EventEmitter.emit (events.js:172:7)
14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at ChildProcess.emit (events.js:172:7)
14 verbose stack at maybeClose (internal/child_process.js:821:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid element-starter@
16 verbose cwd /Users/nwinner/Documents/personal/vuejs/element-starter
17 verbose Darwin 16.4.0
18 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
19 verbose node v5.4.1
20 verbose npm v4.5.0
21 error code ELIFECYCLE
22 error errno 1
23 error element-starter@ dev: webpack-dev-server --inline --hot --env.dev
23 error Exit status 1
24 error Failed at the element-starter@ dev script 'webpack-dev-server --inline --hot --env.dev'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the element-starter package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error webpack-dev-server --inline --hot --env.dev
24 error You can get information on how to open an issue for this project with:
24 error npm bugs element-starter
24 error Or if that isn't available, you can get their info via:
24 error npm owner ls element-starter
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]

index.html中怎么要加一个<div id="app"></div>?

index.html的内容是这样的:

  <body>
    <div id="app"></div>
    <script src="dist/build.js"></script>
  </body>

为什么上面index.html要加一个<div id="app"></div>

APP.vue文件中不是有这个<div id="app"></div>吗?不会重复吗?

<template>
  <div id="app">
    <img src="./assets/logo.png">
    <h1>{{ msg }}</h1>
    <el-button @click.native="startHacking">Let's do it</el-button>
  </div>
</template>

clone/yarn 完 npm run dev 碰到 Error: Cannot find module '../lib/utils/unsupported.js'

Error: Cannot find module '../lib/utils/unsupported.js'
at Function.Module._resolveFilename (module.js:527:15)
at Function.Module._load (module.js:476:23)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:19:21
at Object. (/usr/local/lib/node_modules/npm/bin/npm-cli.js:92:3)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)

webpack.config.js疑问

根据这个Issue,是不是需要添加vuealias

实际项目中,也用到别的插件,不加alias的话终端里会报[Vue warn]: You are using the runtime-only build of Vue where the template option is not available. Either pre-compile the templates into render functions, or use the compiler-included build.

Build fails on Heroku

The build script fails on deployment through Heroku. There is an issue with the following script:
rimraf dist && webpack -p --progress --hide-modules

log:
`Running npm run build on ⬢ pos-client-001... up, run.9308 (Free)

element-starter@ build /app
rimraf dist && webpack -p --progress --hide-modules

sh: 1: webpack: not found

npm ERR! Linux 3.13.0-112-generic
npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "run" "build"
npm ERR! node v7.9.0
npm ERR! npm v4.2.0
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! element-starter@ build: rimraf dist && webpack -p --progress --hide-modules
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the element-starter@ build script 'rimraf dist && webpack -p --progress --hide-modules'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the element-starter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! rimraf dist && webpack -p --progress --hide-modules
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs element-starter
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls element-starter
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /app/.npm/_logs/2017-04-19T11_49_13_070Z-debug.log`

二级路由刷新页面提示没有build.js

正常的页面跳转是可以的,但是二级路由页面刷新就会报错,比如路由写成{path: '/home/:id', component: home},这样的页面,就会出错,用了官方生成的界面,不会出现这样的问题,但是很喜欢element-starter的简洁配置,期望能解决我的疑惑,谢谢了

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.