diff --git a/old_webpack.config.js b/old_webpack.config.js new file mode 100644 index 0000000..6c0a33a --- /dev/null +++ b/old_webpack.config.js @@ -0,0 +1,199 @@ +'use strict' + +const webpack = require('webpack') +const path = require('path') +const CleanWebpackPlugin = require('clean-webpack-plugin') +const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin // eslint-disable-line prefer-destructuring +const DotEnv = require('dotenv-webpack') +const autoprefixer = require('autoprefixer') +const glob = require('glob') +const VueLoaderPlugin = require('vue-loader/lib/plugin') + +const rootFiles = ['index', 'serviceWorkerInstaller', 'vendor'] + +const entry = glob + .sync('./src/**/*.js') + .reduce( + (entries, entryFile) => Object.assign(entries, { [path.parse(entryFile).name]: entryFile }), + {} + ) + +module.exports = { + entry, + output: { + filename: (chunkFileName) => rootFiles.some(file => file === chunkFileName.chunk.name) ? '[name].js' : '[name]/[name].js', + path: path.resolve(__dirname, 'build') + }, + target: 'web', + mode: 'development', + devServer: { + contentBase: path.resolve(__dirname, 'src'), + watchContentBase: true, + compress: true, + port: 3000, + hot: true + }, + resolve: { + extensions: ['.js', '.vue'], + alias: { + vue: 'vue/dist/vue.js' + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader' + }, + { + enforce: 'pre', + test: /\.pug$/, + exclude: /node_modules/, + use: { + loader: 'vue-pug-lint-loader', + options: require('./.pug-lintrc.json') + } + }, + { + test: /\.pug$/, + oneOf: [ + // this applies to `