mikeal / vuejs-electron-demo

Simple Vue.js Electron demo
59 stars 22 forks source link

About webpack config #2

Open ilulu opened 6 years ago

ilulu commented 6 years ago

The base URL your application bundle will be deployed at. This is the equivalent of webpack's output.publicPath, but Vue CLI also needs this value for other purposes, so you should always use baseUrl instead of modifying webpack output.publicPath.

so ,i use like this :

module.exports = {
baseUrl:process.env.NODE_ENV === 'production'
? `${process.cwd()}/dist/`
: '/'
};
vlahanas commented 5 years ago

There is an open pull-request #3 for this

thoni56 commented 5 years ago

Actually, that has changed again. According to the current (at the time of writing) documentation:

The base URL your application bundle will be deployed at (known as baseUrl before Vue CLI 3.3). This is the equivalent of webpack's output.publicPath, but Vue CLI also needs this value for other purposes, so you should always use publicPath instead of modifying webpack output.publicPath.

So this would be what works now:


module.exports = {
  publicPath: `process.env.NODE_ENV === 'production' ? ${process.cwd()}/dist/ : '/'`
}