Remove stale code and dependencies
This commit is contained in:
parent
f333e92489
commit
122773fbfa
|
|
@ -1,17 +0,0 @@
|
|||
'use strict';
|
||||
const path = require('path');
|
||||
const config = require('../config');
|
||||
const packageConfig = require('../package.json');
|
||||
|
||||
const isDev = import.meta.env.MODE !== 'production';
|
||||
|
||||
const assetsPath = (_path) => {
|
||||
const assetsSubDirectory = isDev ? config.dev.assetsSubDirectory : config.build.assetsSubDirectory;
|
||||
|
||||
return path.posix.join(assetsSubDirectory, _path);
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
isDev,
|
||||
assetsPath,
|
||||
};
|
||||
|
|
@ -1,146 +0,0 @@
|
|||
'use strict';
|
||||
const path = require('path');
|
||||
const config = require('../config');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
|
||||
const { VueLoaderPlugin } = require('vue-loader');
|
||||
const ESLintPlugin = require('eslint-webpack-plugin');
|
||||
|
||||
const { isDev, assetsPath } = require('./utils');
|
||||
|
||||
function resolve(dir) {
|
||||
return path.join(__dirname, '..', dir);
|
||||
}
|
||||
|
||||
const eslintOptions = {
|
||||
formatter: require('eslint-formatter-friendly'),
|
||||
emitWarning: !config.dev.showEslintErrorsInOverlay,
|
||||
extensions: ['js', 'ts', 'vue'],
|
||||
};
|
||||
|
||||
//todo: mini-css-extract-plugin? upgrade to webpack 4, then use this
|
||||
//https://github.com/webpack-contrib/mini-css-extract-plugin
|
||||
//todo: do we need postcss?
|
||||
module.exports = {
|
||||
context: path.resolve(__dirname, '../'),
|
||||
entry: {
|
||||
app: './src/main.js',
|
||||
},
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
filename: '[name].js',
|
||||
publicPath: isDev ? config.dev.assetsPublicPath : config.build.assetsPublicPath,
|
||||
},
|
||||
optimization: {
|
||||
splitChunks: {
|
||||
chunks: 'all',
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.ts', '.vue', '.json', '.gql', '.graphql', '.scss'],
|
||||
alias: {
|
||||
'@': resolve('src'),
|
||||
styles: resolve('src/styles'),
|
||||
gql: resolve('src/graphql/gql'),
|
||||
vue: '@vue/compat',
|
||||
},
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
// ...(config.dev.useEslint ? [createLintingRule()] : []),
|
||||
{
|
||||
test: /\.vue$/,
|
||||
loader: 'vue-loader',
|
||||
options: {
|
||||
transformAssetUrls: {
|
||||
video: ['src', 'poster'],
|
||||
source: 'src',
|
||||
img: 'src',
|
||||
image: 'xlink:href',
|
||||
},
|
||||
compilerOptions: {
|
||||
compatConfig: {
|
||||
MODE: 3,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
loader: 'ts-loader',
|
||||
options: {
|
||||
appendTsSuffixTo: [/\.vue$/],
|
||||
},
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['@babel/preset-env'],
|
||||
},
|
||||
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')],
|
||||
},
|
||||
{
|
||||
test: /\.(gql|graphql)$/,
|
||||
loader: 'graphql-tag/loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: assetsPath('img/[name].[hash:7].[ext]'),
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: assetsPath('media/[name].[hash:7].[ext]'),
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: assetsPath('fonts/[name].[hash:7].[ext]'),
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.s?css$/,
|
||||
use: [
|
||||
isDev ? 'vue-style-loader' : MiniCssExtractPlugin.loader,
|
||||
'css-loader',
|
||||
'postcss-loader',
|
||||
{
|
||||
loader: 'sass-loader',
|
||||
options: {
|
||||
additionalData: process.env.THEME ? `@import "styles/themes/_${process.env.THEME}.scss";` : '',
|
||||
sourceMap: isDev,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
// styleRule(false), // css rule
|
||||
// styleRule(true), // sass rule
|
||||
],
|
||||
},
|
||||
plugins: [new VueLoaderPlugin(), new ESLintPlugin(eslintOptions)],
|
||||
|
||||
// node: {
|
||||
// // prevent webpack from injecting useless setImmediate polyfill because Vue
|
||||
// // source contains it (although only uses it if it's native).
|
||||
// setImmediate: false,
|
||||
// // prevent webpack from injecting mocks to Node native modules
|
||||
// // that does not make sense for the client
|
||||
// dgram: 'empty',
|
||||
// fs: 'empty',
|
||||
// net: 'empty',
|
||||
// tls: 'empty',
|
||||
// child_process: 'empty',
|
||||
// },
|
||||
};
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
'use strict';
|
||||
const utils = require('./utils');
|
||||
const webpack = require('webpack');
|
||||
const config = require('../config');
|
||||
const path = require('path');
|
||||
const baseWebpackConfig = require('./webpack.base.conf');
|
||||
const CopyPlugin = require('copy-webpack-plugin');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
const portfinder = require('portfinder');
|
||||
const { merge } = require('webpack-merge');
|
||||
|
||||
const HOST = process.env.HOST;
|
||||
const PORT = process.env.PORT && Number(process.env.PORT);
|
||||
|
||||
const devWebpackConfig = merge(baseWebpackConfig, {
|
||||
// cheap-module-eval-source-map is faster for development
|
||||
devtool: config.dev.devtool,
|
||||
mode: 'development',
|
||||
// these devServer options should be customized in /config/index.js
|
||||
devServer: {
|
||||
client: {
|
||||
logging: 'warn',
|
||||
overlay: config.dev.errorOverlay ? { errors: true, warnings: false } : false,
|
||||
progress: true,
|
||||
},
|
||||
|
||||
historyApiFallback: {
|
||||
rewrites: [{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }],
|
||||
},
|
||||
hot: true,
|
||||
compress: true,
|
||||
host: HOST || config.dev.host,
|
||||
port: PORT || config.dev.port,
|
||||
open: config.dev.autoOpenBrowser,
|
||||
// publicPath: config.dev.assetsPublicPath,
|
||||
proxy: config.dev.proxyTable,
|
||||
// quiet: true, // necessary for FriendlyErrorsPlugin
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': require('../config/dev.env'),
|
||||
// bundler feature flags https://github.com/vuejs/vue-next/tree/master/packages/vue#bundler-build-feature-flags
|
||||
__VUE_OPTIONS_API__: true, // default, but explicit
|
||||
__VUE_PROD_DEVTOOLS__: false, // default, but explicit
|
||||
}),
|
||||
// https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: 'index.html',
|
||||
...require('../config/dev.env'),
|
||||
}),
|
||||
// copy custom static assets
|
||||
new CopyPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.dev.assetsSubDirectory,
|
||||
globOptions: {
|
||||
ignore: ['.*'],
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
new BundleAnalyzerPlugin({
|
||||
analyzerMode: 'disabled', // do nothing by default, but be able to generate stats with --profile
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
module.exports = new Promise((resolve, reject) => {
|
||||
portfinder.basePort = process.env.PORT || config.dev.port;
|
||||
portfinder.getPort((err, port) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
// publish the new Port, necessary for e2e tests
|
||||
process.env.PORT = port;
|
||||
// add port to devServer config
|
||||
devWebpackConfig.devServer.port = port;
|
||||
|
||||
// Add FriendlyErrorsPlugin
|
||||
// todo: seems to not be maintained anymore, disable for now
|
||||
// devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
|
||||
// compilationSuccessInfo: {
|
||||
// messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
|
||||
// },
|
||||
// onErrors: config.dev.notifyOnErrors
|
||||
// ? utils.createNotifierCallback()
|
||||
// : undefined,
|
||||
// }));
|
||||
|
||||
resolve(devWebpackConfig);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -1,140 +0,0 @@
|
|||
'use strict';
|
||||
const path = require('path');
|
||||
const utils = require('./utils');
|
||||
const webpack = require('webpack');
|
||||
const config = require('../config');
|
||||
const { merge } = require('webpack-merge');
|
||||
const baseWebpackConfig = require('./webpack.base.conf');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
||||
|
||||
const env = require('../config/prod.env');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const SentryWebpackPlugin = require('@sentry/webpack-plugin');
|
||||
|
||||
const sentryPlugin = [];
|
||||
if (process.env.SENTRY_AUTH_TOKEN) {
|
||||
sentryPlugin.push(
|
||||
new SentryWebpackPlugin({
|
||||
org: 'iterativ',
|
||||
project: 'skillbox-vue',
|
||||
include: config.build.assetsRoot,
|
||||
authToken: process.env.SENTRY_AUTH_TOKEN,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
const webpackConfig = merge(baseWebpackConfig, {
|
||||
devtool: config.build.productionSourceMap ? config.build.devtool : false,
|
||||
mode: 'production',
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
filename: utils.assetsPath('js/[name].[chunkhash].js'),
|
||||
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js'),
|
||||
},
|
||||
optimization: {
|
||||
minimizer: [new CssMinimizerPlugin()],
|
||||
},
|
||||
plugins: [
|
||||
...sentryPlugin,
|
||||
// http://vuejs.github.io/vue-loader/en/workflow/production.html
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': env,
|
||||
// bundler feature flags https://github.com/vuejs/vue-next/tree/master/packages/vue#bundler-build-feature-flags
|
||||
__VUE_OPTIONS_API__: true, // default, but explicit
|
||||
__VUE_PROD_DEVTOOLS__: false, // default, but explicit
|
||||
}),
|
||||
// extract css into its own file
|
||||
new MiniCssExtractPlugin({
|
||||
filename: utils.assetsPath('css/[name].[contenthash].css'),
|
||||
}),
|
||||
// generate dist index.html with correct asset hash for caching.
|
||||
// you can customize output by editing /index.html
|
||||
// see https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: config.build.index,
|
||||
template: 'index.html',
|
||||
...require('../config/prod.env'),
|
||||
minify: {
|
||||
// defaults from https://github.com/jantimon/html-webpack-plugin#minification
|
||||
collapseWhitespace: true,
|
||||
keepClosingSlash: true,
|
||||
removeComments: true,
|
||||
removeRedundantAttributes: true,
|
||||
removeScriptTypeAttributes: true,
|
||||
removeStyleLinkTypeAttributes: true,
|
||||
useShortDoctype: true,
|
||||
},
|
||||
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
|
||||
chunksSortMode: 'auto',
|
||||
}),
|
||||
// keep module.id stable when vendor modules does not change
|
||||
new webpack.ids.HashedModuleIdsPlugin(),
|
||||
// split vendor js into its own file
|
||||
// todo: https://gist.github.com/sokra/1522d586b8e5c0f5072d7565c2bee693
|
||||
// todo: do we need this? probably default is fine
|
||||
// new webpack.optimize.CommonsChunkPlugin({
|
||||
// name: 'vendor',
|
||||
// minChunks (module) {
|
||||
// // any required modules inside node_modules are extracted to vendor
|
||||
// return (
|
||||
// module.resource &&
|
||||
// /\.js$/.test(module.resource) &&
|
||||
// module.resource.indexOf(
|
||||
// path.join(__dirname, '../node_modules')
|
||||
// ) === 0
|
||||
// )
|
||||
// }
|
||||
// }),
|
||||
// extract webpack runtime and module manifest to its own file in order to
|
||||
// prevent vendor hash from being updated whenever app bundle is updated
|
||||
// new webpack.optimize.CommonsChunkPlugin({
|
||||
// name: 'manifest',
|
||||
// minChunks: Infinity
|
||||
// }),
|
||||
// This instance extracts shared chunks from code splitted chunks and bundles them
|
||||
// in a separate chunk, similar to the vendor chunk
|
||||
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
|
||||
// new webpack.optimize.CommonsChunkPlugin({
|
||||
// name: 'app',
|
||||
// async: 'vendor-async',
|
||||
// children: true,
|
||||
// minChunks: 3
|
||||
// }),
|
||||
|
||||
// copy custom static assets
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.build.assetsSubDirectory,
|
||||
globOptions: {
|
||||
ignore: ['.*'],
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
if (config.build.productionGzip) {
|
||||
const CompressionWebpackPlugin = require('compression-webpack-plugin');
|
||||
|
||||
webpackConfig.plugins.push(
|
||||
new CompressionWebpackPlugin({
|
||||
asset: '[path].gz[query]',
|
||||
algorithm: 'gzip',
|
||||
test: new RegExp('\\.(' + config.build.productionGzipExtensions.join('|') + ')$'),
|
||||
threshold: 10240,
|
||||
minRatio: 0.8,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
if (config.build.bundleAnalyzerReport) {
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
webpackConfig.plugins.push(new BundleAnalyzerPlugin());
|
||||
}
|
||||
|
||||
module.exports = webpackConfig;
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
'use strict';
|
||||
const { merge } = require('webpack-merge');
|
||||
const prodEnv = require('./prod.env');
|
||||
|
||||
module.exports = merge(prodEnv, {
|
||||
NODE_ENV: '"development"',
|
||||
VUE_APP_ENABLE_SPELLCHECK: 'true',
|
||||
});
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
'use strict';
|
||||
// Template version: 1.3.1
|
||||
// see http://vuejs-templates.github.io/webpack for documentation.
|
||||
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
dev: {
|
||||
// Paths
|
||||
assetsSubDirectory: 'static',
|
||||
assetsPublicPath: '/',
|
||||
proxyTable: {},
|
||||
|
||||
// Various Dev Server settings
|
||||
host: 'localhost', // can be overwritten by process.env.HOST
|
||||
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
||||
autoOpenBrowser: false,
|
||||
errorOverlay: true,
|
||||
notifyOnErrors: true,
|
||||
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
|
||||
|
||||
// Use Eslint Loader?
|
||||
// If true, your code will be linted during bundling and
|
||||
// linting errors and warnings will be shown in the console.
|
||||
useEslint: true,
|
||||
// If true, eslint errors and warnings will also be shown in the error overlay
|
||||
// in the browser.
|
||||
showEslintErrorsInOverlay: false,
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
*/
|
||||
|
||||
// https://webpack.js.org/configuration/devtool/#development
|
||||
// devtool: 'cheap-module-eval-source-map',
|
||||
devtool: 'eval-cheap-module-source-map',
|
||||
|
||||
// If you have problems debugging vue-files in devtools,
|
||||
// set this to false - it *may* help
|
||||
// https://vue-loader.vuejs.org/en/options.html#cachebusting
|
||||
cacheBusting: true,
|
||||
|
||||
cssSourceMap: true,
|
||||
},
|
||||
|
||||
build: {
|
||||
// Template for index.html
|
||||
index: path.resolve(__dirname, '../dist/index.html'),
|
||||
assetsRoot: path.resolve(__dirname, '../dist'),
|
||||
|
||||
assetsSubDirectory: 'static',
|
||||
assetsPublicPath: '/',
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
*/
|
||||
|
||||
productionSourceMap: true,
|
||||
// https://webpack.js.org/configuration/devtool/#production
|
||||
devtool: 'source-map',
|
||||
|
||||
// Gzip off by default as many popular static hosts such as
|
||||
// Surge or Netlify already gzip all static assets for you.
|
||||
// Before setting to `true`, make sure to:
|
||||
// npm install --save-dev compression-webpack-plugin
|
||||
productionGzip: false,
|
||||
productionGzipExtensions: ['js', 'css'],
|
||||
|
||||
// Run the build command with an extra argument to
|
||||
// View the bundle analyzer report after build finishes:
|
||||
// `npm run build --report`
|
||||
// Set to `true` or `false` to always turn it on or off
|
||||
bundleAnalyzerReport: process.env.npm_config_report,
|
||||
},
|
||||
};
|
||||
|
|
@ -14,7 +14,6 @@ require('tsconfig-paths').register();
|
|||
|
||||
const { readFileSync } = require('fs');
|
||||
const { resolve } = require('path');
|
||||
// import webpackPreprocessor from '@cypress/webpack-preprocessor';
|
||||
|
||||
module.exports = (on) => {
|
||||
// `on` is used to hook into various events Cypress emits
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -47,7 +47,6 @@
|
|||
"@rollup/plugin-graphql": "^1.1.0",
|
||||
"@sentry/vite-plugin": "^2.5.0",
|
||||
"@sentry/vue": "^7.60.1",
|
||||
"@sentry/webpack-plugin": "^1.20.0",
|
||||
"@tiptap/core": "^2.0.0-beta.174",
|
||||
"@tiptap/extension-bullet-list": "^2.0.0-beta.26",
|
||||
"@tiptap/extension-document": "^2.0.0-beta.15",
|
||||
|
|
@ -66,12 +65,8 @@
|
|||
"autoprefixer": "^10.4.12",
|
||||
"babel-core": "^7.0.0-bridge.0",
|
||||
"babel-jest": "^29.2.2",
|
||||
"babel-loader": "^8.0.6",
|
||||
"chalk": "^2.0.1",
|
||||
"copy-webpack-plugin": "^10.1.0",
|
||||
"core-js": "^3.26.0",
|
||||
"css-loader": "^3.6.0",
|
||||
"css-minimizer-webpack-plugin": "^3.4.1",
|
||||
"cy2": "^1.2.1",
|
||||
"cypress": "^12.6.0",
|
||||
"cypress-cloud": "^1.7.3",
|
||||
|
|
@ -81,13 +76,10 @@
|
|||
"eslint-formatter-friendly": "^7.0.0",
|
||||
"eslint-plugin-cypress": "^2.12.1",
|
||||
"eslint-plugin-vue": "^9.6.0",
|
||||
"eslint-webpack-plugin": "^3.2.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"graphql": "^16.3.0",
|
||||
"graphql-config": "^4.3.0",
|
||||
"graphql-tag": "^2.10.1",
|
||||
"graphql-tools": "^8.2.5",
|
||||
"html-webpack-plugin": "^5.5.0",
|
||||
"jest": "^29.2.2",
|
||||
"jest-environment-jsdom": "^29.2.2",
|
||||
"jest-serializer-vue": "^2.0.2",
|
||||
|
|
@ -101,34 +93,24 @@
|
|||
"ora": "^1.2.0",
|
||||
"portfinder": "^1.0.13",
|
||||
"postcss-import": "^15.0.0",
|
||||
"postcss-loader": "^7.0.1",
|
||||
"postcss-url": "^10.1.3",
|
||||
"prettier": "2.8.2",
|
||||
"rimraf": "^2.6.0",
|
||||
"sass": "^1.56.1",
|
||||
"sass-loader": "^12.6.0",
|
||||
"semver": "^5.3.0",
|
||||
"shelljs": "^0.8.5",
|
||||
"survey-knockout": "^1.9.41",
|
||||
"typescript": "^4.6.4",
|
||||
"uploadcare-widget": "^3.6.0",
|
||||
"url-loader": "^4.1.1",
|
||||
"vee-validate": "^4.5.10",
|
||||
"vite": "^3.1.0",
|
||||
"vue": "3.2.30",
|
||||
"vue-loader": "^16.8.3",
|
||||
"vue-matomo": "^4.2.0",
|
||||
"vue-router": "^4.0.14",
|
||||
"vue-scrollto": "^2.20.0",
|
||||
"vue-style-loader": "^3.0.1",
|
||||
"vue-tsc": "^0.40.4",
|
||||
"vue-vimeo-player": "^1.1.2",
|
||||
"vuex": "4.0.1",
|
||||
"webpack": "^5.67.0",
|
||||
"webpack-bundle-analyzer": "^4.5.0",
|
||||
"webpack-cli": "^4.9.1",
|
||||
"webpack-dev-server": "^4.6.0",
|
||||
"webpack-merge": "^5.8.0"
|
||||
"vuex": "4.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 14.x",
|
||||
|
|
|
|||
Loading…
Reference in New Issue