Skip to content

Commit

Permalink
Merge pull request #1234 from myrotvorets/bootstrap
Browse files Browse the repository at this point in the history
Refactoring + conversion to Bootstrap
  • Loading branch information
myrotvorets-team authored Oct 21, 2023
2 parents d752d2b + 3d8feba commit c0535f4
Show file tree
Hide file tree
Showing 91 changed files with 3,140 additions and 3,677 deletions.
3 changes: 0 additions & 3 deletions .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ module.exports = function(api) {
"pragmaFrag": "Fragment"
}],
process.env.BUILD_SSR ? ["babel-plugin-dynamic-import-node-sync"] : null,
["@babel/plugin-transform-class-properties", { "loose": true }],
["@babel/plugin-transform-optional-chaining", { "loose": true }],
["@babel/plugin-transform-numeric-separator"]
].filter(Boolean)
};

Expand Down
7 changes: 1 addition & 6 deletions .webpack/webpack.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { type Configuration as DevServerConfiguration } from 'webpack-dev-server
import path from 'path';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
import { InjectManifest } from 'workbox-webpack-plugin';
import { HwpAttributesPlugin } from 'hwp-attributes-plugin';
import { execSync } from 'child_process';
import { Config as SVGOConfig } from 'svgo';
Expand Down Expand Up @@ -141,15 +140,11 @@ export const commonConfiguration: Configuration & { devServer: DevServerConfigur
keepClosingSlash: true,
html5: true,
minifyCSS: true,
minifyJS: true,
sortAttributes: true,
sortClassName: true,
},
}),
new InjectManifest({
swSrc: './src/sw.ts',
include: ['index.html', /\.js$/u, /\.svg$/u, /\.css$/u],
dontCacheBustURLsMatching: /\.[0-9a-f]{5}\.min\.(js|css)/u,
}),
new HwpAttributesPlugin({
module: ['/**.mjs'],
}),
Expand Down
25 changes: 6 additions & 19 deletions .webpack/webpack.production.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import type { Configuration } from 'webpack';
import { merge } from 'webpack-merge';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import TerserPlugin from 'terser-webpack-plugin';
import { PurgeCSSPlugin } from 'purgecss-webpack-plugin';
import { SubresourceIntegrityPlugin } from 'webpack-subresource-integrity';
import { HwpInlineRuntimeChunkPlugin } from 'hwp-inline-runtime-chunk-plugin';
import { sync } from 'glob';
import { InjectManifest } from 'workbox-webpack-plugin';
import { commonConfiguration } from './webpack.common';

export function productionConfiguration(): Configuration {
Expand Down Expand Up @@ -49,15 +48,6 @@ export function productionConfiguration(): Configuration {
],
},
plugins: [
new PurgeCSSPlugin({
paths: sync(`${path.join(__dirname, '../src')}/**/*`, {
nodir: true,
}),
blocklist: [],
safelist: {
greedy: [/wa-mediabox/u],
},
}),
new MiniCssExtractPlugin({
filename: '[name].[contenthash:5].min.css',
chunkFilename: '[name].[contenthash:5].min.css',
Expand All @@ -66,6 +56,11 @@ export function productionConfiguration(): Configuration {
new SubresourceIntegrityPlugin({
hashFuncNames: ['sha384'],
}),
new InjectManifest({
swSrc: './src/sw.ts',
include: ['index.html', /\.js$/u, /\.svg$/u, /\.css$/u],
dontCacheBustURLsMatching: /\.[0-9a-f]{5}\.min\.(js|css)/u,
}),
],
optimization: {
runtimeChunk: 'single',
Expand All @@ -86,14 +81,6 @@ export function productionConfiguration(): Configuration {
keep_fargs: false,
pure_getters: true,
hoist_funs: true,
pure_funcs: [
'classCallCheck',
'_classCallCheck',
'_possibleConstructorReturn',
'Object.freeze',
'invariant',
'warning',
],
},
},
extractComments: false,
Expand Down
21 changes: 21 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[build]
publish = "dist/"

[[redirects]]
from = "/*"
to = "/"
status = 200

[[headers]]
for = "/index.html"
[headers.values]
cache-control = '''
max-age=0,
must-revalidate'''

[[headers]]
for = "/sw.js"
[headers.values]
cache-control = '''
max-age=0,
must-revalidate'''
Loading

0 comments on commit c0535f4

Please sign in to comment.