Files
directus/vue.config.js
Rijk van Zanten 0c745a6eee Switch to history mode in app (#594)
* Switch to history mode in pp

* Remove broken tests

* Install asset manifest

* Only build to modern

* Remove override files in favor of settings

* Build assets json

* Use dynamic routing based on api basepath

* Remove override files

* Set webpack public path based on passed window var

* Fix tests
2020-05-19 17:16:44 -04:00

42 lines
1.1 KiB
JavaScript

/* @tslint:disable */
/* eslint-disable */
const WebpackAssetsManifest = require('webpack-assets-manifest');
if (!process.env.API_URL && process.env.NODE_ENV === 'development') {
console.log(`
⚠️ No API URL passed. Using the demo API as a fallback.
`);
}
module.exports = {
lintOnSave: false,
publicPath: '/admin/',
devServer: {
allowedHosts: ['localhost', '.gitpod.io'],
public: '127.0.0.1:8080',
proxy: {
'/': {
target: process.env.API_URL ? process.env.API_URL : 'https://demo.directus.io/',
changeOrigin: true,
bypass: (req) => (req.url.startsWith('/admin') ? req.url : null),
},
},
},
configureWebpack: {
plugins: [new WebpackAssetsManifest({ output: 'assets.json' })],
},
// There are so many chunks (from all the interfaces / layouts) that we need to make sure to not
// prefetch them all. Prefetching them all will cause the server to apply rate limits in most cases
chainWebpack: (config) => {
config.plugins.delete('prefetch');
if (process.env.NODE_ENV === 'development') {
config.output.filename('[name].[hash].js').end();
}
},
};