-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove legacy scss styles, change to full webpack build
- Loading branch information
1 parent
a269fe9
commit cdc61f4
Showing
45 changed files
with
8,203 additions
and
11,188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,6 +95,7 @@ module.exports = { | |
globals: { | ||
mount: false, | ||
shallowMount: false, | ||
fail: false, | ||
}, | ||
}, | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module.exports = { | ||
presets: ["@vue/cli-plugin-babel/preset"], | ||
presets: ["@babel/preset-env"], | ||
}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,195 @@ | ||
const path = require("path"); | ||
const HtmlWebpackPlugin = require("html-webpack-plugin"); | ||
const { VueLoaderPlugin } = require("vue-loader"); | ||
const { VuetifyPlugin } = require("webpack-plugin-vuetify"); | ||
const NoncePlaceholderPlugin = require("./nonce-placeholder-plugin"); | ||
const { DefinePlugin, ProgressPlugin } = require("webpack"); | ||
const CopyPlugin = require("copy-webpack-plugin"); | ||
const ESLintWebpackPlugin = require("eslint-webpack-plugin"); | ||
|
||
const __base = path.resolve(__dirname, "../.."); | ||
const __src = path.resolve(__base, "src"); | ||
|
||
const getDir = (subPath) => path.resolve(__base, subPath); | ||
|
||
module.exports = { | ||
devtool: false, // "source-map", see https://webpack.js.org/configuration/devtool/ | ||
|
||
// Entry: main file | ||
entry: { | ||
app: [path.resolve(__src, "main.ts")], | ||
}, | ||
|
||
// Output | ||
output: { | ||
filename: "_vue/js/[name].js", | ||
path: path.resolve(__base, "dist"), | ||
publicPath: "/", | ||
chunkFilename: "_vue/js/[name].js", | ||
clean: true, | ||
}, | ||
|
||
// Optimizations | ||
optimization: { | ||
realContentHash: false, | ||
splitChunks: { | ||
cacheGroups: { | ||
defaultVendors: { | ||
name: "chunk-vendors", | ||
test: /[\\/]node_modules[\\/]/, | ||
priority: -10, | ||
chunks: "initial", | ||
}, | ||
common: { | ||
name: "chunk-common", | ||
minChunks: 2, | ||
priority: -20, | ||
chunks: "initial", | ||
reuseExistingChunk: true, | ||
}, | ||
}, | ||
}, | ||
}, | ||
|
||
// Plugins | ||
plugins: [ | ||
new DefinePlugin({ | ||
__VUE_OPTIONS_API__: "false", | ||
__VUE_PROD_DEVTOOLS__: "false", | ||
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "false", | ||
}), | ||
|
||
new ProgressPlugin(), | ||
|
||
new VueLoaderPlugin(), | ||
new VuetifyPlugin({ styles: { configFile: "src/styles/settings.scss" } }), | ||
|
||
new NoncePlaceholderPlugin(), | ||
|
||
new HtmlWebpackPlugin({ | ||
title: "Superhero-Dashboard", | ||
scriptLoading: "defer", | ||
favicon: path.resolve(__base, "public", "favicon.png"), | ||
template: path.resolve(__base, "index.html"), | ||
}), | ||
|
||
new CopyPlugin({ | ||
patterns: [ | ||
{ | ||
from: path.resolve(__base, "public"), | ||
to: path.resolve(__base, "dist"), | ||
toType: "dir", | ||
noErrorOnMissing: true, | ||
globOptions: { | ||
ignore: ["**/.DS_Store"], | ||
}, | ||
info: { | ||
minimized: true, | ||
}, | ||
}, | ||
], | ||
}), | ||
|
||
new ESLintWebpackPlugin({ | ||
extensions: [".js", ".jsx", ".vue", ".ts", ".tsx"], | ||
failOnWarning: false, | ||
failOnError: true, | ||
}), | ||
], | ||
|
||
resolve: { | ||
alias: { | ||
"@": path.resolve(__src), | ||
"@data": getDir("src/modules/data"), | ||
"@feature": getDir("src/modules/feature"), | ||
"@ui": getDir("src/modules/ui"), | ||
"@util": getDir("src/modules/util"), | ||
"@page": getDir("src/modules/page"), | ||
}, | ||
extensions: [".tsx", ".ts", ".mjs", ".js", ".jsx", ".vue", ".json"], | ||
}, | ||
|
||
//Webpack dosent know how to handler all type of files and what to do with them, so this section | ||
//we can capture and configure a specific type of file and determine a loader plugin to process it | ||
module: { | ||
rules: [ | ||
// Javascript | ||
{ | ||
test: /\.m?jsx?$/, | ||
exclude: /node_modules/, | ||
use: ["babel-loader"], | ||
}, | ||
// Typescript | ||
{ | ||
test: /\.tsx?$/, | ||
use: [ | ||
{ | ||
loader: "babel-loader", | ||
}, | ||
{ | ||
loader: "ts-loader", | ||
options: { | ||
transpileOnly: true, | ||
appendTsSuffixTo: [/\.vue$/], | ||
happyPackMode: false, | ||
configFile: path.resolve(__base, "tsconfig.build.json"), | ||
}, | ||
}, | ||
], | ||
}, | ||
// I18n - TS | ||
{ | ||
test: /\.ts$/, | ||
type: "javascript/auto", | ||
loader: path.resolve(__dirname, "vue-i18n-loader.js"), | ||
include: [path.resolve(__src, "locales")], | ||
}, | ||
// Vue | ||
{ | ||
test: /\.vue$/, | ||
loader: "vue-loader", | ||
}, | ||
// SVG | ||
{ | ||
test: /\.(svg)(\?.*)?$/, | ||
type: "asset/resource", | ||
generator: { | ||
filename: "_vue/img/[name].[hash:8][ext]", | ||
}, | ||
}, | ||
// Images | ||
{ | ||
test: /\.(png|jpe?g|gif|webp|avif)(\?.*)?$/, | ||
type: "asset", | ||
generator: { | ||
filename: "_vue/img/[name].[hash:8][ext]", | ||
}, | ||
}, | ||
// Media | ||
{ | ||
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, | ||
type: "asset", | ||
generator: { | ||
filename: "_vue/media/[name].[hash:8][ext]", | ||
}, | ||
}, | ||
// Fonts | ||
{ | ||
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/i, | ||
type: "asset", | ||
generator: { | ||
filename: "_vue/fonts/[name].[hash:8][ext]", | ||
}, | ||
}, | ||
// CSS, SCSS | ||
{ | ||
test: /\.css$/, | ||
use: ["vue-style-loader", "css-loader"], | ||
}, | ||
{ | ||
test: /\.(s([ac])ss)$/, | ||
use: ["vue-style-loader", "css-loader", "sass-loader"], | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const { merge } = require("webpack-merge"); | ||
const common = require("./webpack.common"); | ||
const { DefinePlugin } = require("webpack"); | ||
|
||
//Configure dev enviroment by combining common configuration and adding some more options | ||
module.exports = merge(common, { | ||
mode: "development", | ||
devtool: "inline-source-map", | ||
plugins: [ | ||
new DefinePlugin({ | ||
"process.env": { | ||
NODE_ENV: '"development"', | ||
}, | ||
}), | ||
], | ||
devServer: | ||
process.env.NODE_ENV === "development" | ||
? { | ||
port: 4100, | ||
allowedHosts: "all", | ||
client: { | ||
overlay: false, | ||
}, | ||
} | ||
: {}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const { merge } = require("webpack-merge"); | ||
const common = require("./webpack.common"); | ||
const { DefinePlugin } = require("webpack"); | ||
|
||
// Configure prod enviroment by using common configuration and adding some more options | ||
module.exports = merge(common, { | ||
mode: "production", | ||
devtool: false, | ||
plugins: [ | ||
new DefinePlugin({ | ||
"process.env": { | ||
NODE_ENV: '"production"', | ||
}, | ||
}), | ||
], | ||
// we can add many of optimizations configurations as minification, compression and so on, | ||
// but to be a minumal project example so its needs to have only minimal configuration | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.