Skip to content

modify assetsPublicPath lead to "can not get" #74

@rayzang8

Description

@rayzang8

Use the webpack template.
Issue: I modified the assetsPublicPath option in config.js when to built my project, it's run properly.
but when I run dev agian, the page "can not get" appears.

So I find the cause. If the assetsPublicPath change from '/' to others, the dev server can not find the
rootpath when npm run dev. Then I add a option in config.js
dev: {
assetsPublicPath:'/',
port: 8080,
proxyTable: {}
}

and modify dev-server.js
var staticPath = path.posix.join( config.dev.assetsPublicPath, config.build.assetsSubDirectory)

finally modify webpack.base.conf.js
output: {
path: config.build.assetsRoot,
publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath ,
filename: '[name].js'
}

So, I do not have to modify assetsPublicPath option after npm run build every time.

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