const { VueLoaderPlugin } = require('vue-loader')
const path = require('path')
const Dotenv = require('dotenv-webpack')

module.exports = {
	entry: './main.js',
	entry: {
	    register: {
	        import: './grav-admin/user/js/registration/registration.js',
	        filename: 'register.js',
	    }
	},
	output: {
		path: path.resolve(__dirname, 'grav-admin/user/themes/quark/assets'),
	},
	module: { 
		rules: [
			{test: /\.vue$/, use: 'vue-loader'},
			{test: /\.css$/, use: ['style-loader', 'css-loader']}
		]
	},
	devServer: {
		static: './assets',
		proxy: {
			'*': {target: 'http://localhost:8001',
				secure: false,
				changeOrigin: true
			}
		}
	},
	// Required for also applying rules to sections of SFC
	plugins: [new VueLoaderPlugin(), new Dotenv({systemVars: true})],
};
