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

module.exports = {
	entry: './main.js',
	entry: {
	    main: {
	        import: './main.js',
	        filename: 'app.js',
	    },
	},
	output: {
		path: path.resolve(__dirname, '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})],
};
