const TransformPages = require('uni-read-pages')
const ScriptSetup = require('unplugin-vue2-script-setup/webpack').default;
const {
	webpack
} = new TransformPages()
module.exports = {
	configureWebpack: {
		plugins: [
			new webpack.DefinePlugin({
				ROUTES: webpack.DefinePlugin.runtimeValue(() => {
					const tfPages = new TransformPages({
						includes: ['path', 'name', 'aliasPath', 'meta']
					});
					return JSON.stringify(tfPages.routes)
				}, true)
			}),
			ScriptSetup({
				/* options */
			}),
		]

	},
	chainWebpack(config) {
		// disable type check and let `vue-tsc` handles it
		config.plugins.delete('fork-ts-checker');
	},
}