Skip to content

Building empty webpack project doesn't work #392

Closed
@ajrothwell

Description

@ajrothwell

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions