Skip to content

Commit

Permalink
generated base landing page and broke webpack.
Browse files Browse the repository at this point in the history
  • Loading branch information
SKOLZ committed Sep 4, 2021
1 parent 2c0414c commit 9bb15fc
Show file tree
Hide file tree
Showing 28 changed files with 9,111 additions and 10,484 deletions.
199 changes: 199 additions & 0 deletions old_webpack.config.js
Original file line number Diff line number Diff line change
@@ -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 `<template lang="pug">` in Vue components
{
resourceQuery: /^\?vue/,
use: ['pug-plain-loader']
},
{
use: [
{
loader: 'file-loader',
options: {
name(file) {
return file.includes('index') ? '[name].html' : '[name]/index.html'
}
}
},
'pug-plain-loader'
]
}
]
},
{
enforce: 'pre',
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'eslint-loader',
options: {
configFile: '.eslintrc',
cache: true,
emitError: true,
emitWarning: true
}
}
},
{
test: /\.js$/,
exclude: /node_modules/,
use: 'babel-loader'
},
{
test: /\.scss$/,
exclude: /node_modules/,
use: [
{
loader: 'style-loader',
options: {
hmr: true
}
},
'css-loader',
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
autoprefixer({
browsers: [
'>1%',
'last 4 versions',
'Firefox ESR',
'not ie <9'
],
flexbox: 'no-2009'
})
]
}
},
{
loader: 'sass-loader',
options: {
includePaths: [path.resolve(__dirname, 'src/scss')]
}
}
]
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
autoprefixer({
browsers: [
'>1%',
'last 4 versions',
'Firefox ESR',
'not ie <9'
],
flexbox: 'no-2009'
})
]
}
}
]
},
{
test: /\.(jpg|png|gif|otf)$/,
use: 'file-loader?name=assets/[name].[ext]'
},
{
test: /\.svg$/,
loader: 'vue-svg-loader',
options: {
svgo: {
plugins: [
{cleanupIDs: false},
{convertPathData: false},
{mergePaths: false}
]
}
}
}
]
},
plugins: [
new CleanWebpackPlugin(['build']),
new DotEnv(),
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin(),
new BundleAnalyzerPlugin({
openAnalyzer: false
}),
new VueLoaderPlugin()
],
devtool: 'eval',
optimization: {
splitChunks: {
chunks: 'async'
}
},
performance: {
hints: false
}
}
Loading

0 comments on commit 9bb15fc

Please sign in to comment.