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

Building empty webpack project doesn't work #392

Closed
ajrothwell opened this issue Mar 9, 2017 · 1 comment
Closed

Building empty webpack project doesn't work #392

ajrothwell opened this issue Mar 9, 2017 · 1 comment

Comments

@ajrothwell
Copy link

ajrothwell commented Mar 9, 2017

I'm just getting started with vue-cli and wanted to try building an empty copy of the webpack template for deployment. This is what I did:

vue init webpack gazpachoapp
cd gazpachoapp
npm install
vue build --prod src/main.js

That last command gives an error:

ERROR in ./src/router/index.js
Module not found: Error: Can't resolve '@/components/Hello' in '/home/ubuntu/workspace/gazpachoapp/src/router'
 @ ./src/router/index.js 3:0-39
 @ ./src/main.js
 @ multi src/main.js

The if I change that line in src/router/index.js to:

import Hello from '../components/Hello'

it works, but when I build and start serving the dist folder it looks totally blank in the browser. Am I doing something wrong?

Thanks!

@posva
Copy link
Member

posva commented Mar 9, 2017

the vue build command allows you to test and bundle libs easily, but the webpack template doesn't need it. Just use the npm run build command inside of it. You should read the template's readme too

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

2 participants