remove webpack

This commit is contained in:
tamaina 2022-04-27 20:48:26 +09:00
parent 4a8ce0395c
commit 3d167a1ef0
3 changed files with 22 additions and 2096 deletions

View File

@ -30,8 +30,6 @@
"chartjs-plugin-zoom": "1.2.1",
"compare-versions": "4.1.3",
"content-disposition": "0.5.4",
"css-loader": "6.7.1",
"cssnano": "5.1.7",
"date-fns": "2.28.0",
"escape-regexp": "0.0.1",
"eslint": "8.14.0",
@ -42,7 +40,6 @@
"idb-keyval": "6.1.0",
"insert-text-at-cursor": "0.3.0",
"json5": "2.2.1",
"json5-loader": "4.0.1",
"katex": "0.15.3",
"matter-js": "0.18.0",
"mfm-js": "0.21.0",
@ -53,8 +50,6 @@
"parse5": "6.0.1",
"photoswipe": "5.2.4",
"portscanner": "2.2.0",
"postcss": "8.4.12",
"postcss-loader": "6.2.1",
"prismjs": "1.28.0",
"private-ip": "2.3.3",
"promise-limit": "2.7.0",
@ -68,17 +63,14 @@
"rollup": "2.70.2",
"s-age": "1.1.2",
"sass": "1.50.1",
"sass-loader": "12.6.0",
"seedrandom": "3.0.5",
"strict-event-emitter-types": "2.0.0",
"stringz": "2.1.0",
"style-loader": "3.3.1",
"syuilo-password-strength": "0.0.1",
"textarea-caret": "3.1.0",
"three": "0.139.2",
"throttle-debounce": "4.0.1",
"tinycolor2": "1.4.2",
"ts-loader": "9.2.8",
"tsc-alias": "1.5.0",
"tsconfig-paths": "3.14.1",
"twemoji-parser": "14.0.0",
@ -88,14 +80,9 @@
"vanilla-tilt": "1.7.2",
"vite": "2.9.5",
"vue": "3.2.33",
"vue-loader": "17.0.0",
"vue-prism-editor": "2.0.0-alpha.2",
"vue-router": "4.0.14",
"vue-style-loader": "4.1.3",
"vue-svg-loader": "0.17.0-beta.2",
"vuedraggable": "4.0.1",
"webpack": "5.72.0",
"webpack-cli": "4.9.2",
"websocket": "1.0.34",
"ws": "8.5.0"
},
@ -117,8 +104,6 @@
"@types/throttle-debounce": "4.0.0",
"@types/tinycolor2": "1.4.3",
"@types/uuid": "8.3.4",
"@types/webpack": "5.28.0",
"@types/webpack-stream": "3.2.12",
"@types/websocket": "1.0.5",
"@types/ws": "8.5.3",
"@typescript-eslint/eslint-plugin": "5.20.0",

View File

@ -1,192 +0,0 @@
/**
* webpack configuration
*/
const fs = require('fs');
const webpack = require('webpack');
const { VueLoaderPlugin } = require('vue-loader');
class WebpackOnBuildPlugin {
constructor(callback) {
this.callback = callback;
}
apply(compiler) {
compiler.hooks.done.tap('WebpackOnBuildPlugin', this.callback);
}
}
const isProduction = process.env.NODE_ENV === 'production';
const locales = require('../../locales');
const meta = require('../../package.json');
const postcss = {
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: [
require('cssnano')({
preset: 'default'
})
]
}
},
};
module.exports = {
entry: {
app: './src/init.ts',
},
module: {
rules: [{
test: /\.vue$/,
exclude: /node_modules/,
use: [{
loader: 'vue-loader',
options: {
cssSourceMap: false,
reactivityTransform: true,
compilerOptions: {
preserveWhitespace: false
}
}
}]
}, {
test: /\.scss?$/,
exclude: /node_modules/,
oneOf: [{
resourceQuery: /module/,
use: [{
loader: 'vue-style-loader'
}, {
loader: 'css-loader',
options: {
modules: true,
esModule: false, // TODO: trueにすると壊れる。Vue3移行の折にはtrueにできるかもしれない
url: false,
}
}, postcss, {
loader: 'sass-loader',
options: {
implementation: require('sass'),
sassOptions: {
fiber: false
}
}
}]
}, {
use: [{
loader: 'vue-style-loader'
}, {
loader: 'css-loader',
options: {
url: false,
esModule: false, // TODO: trueにすると壊れる。Vue3移行の折にはtrueにできるかもしれない
}
}, postcss, {
loader: 'sass-loader',
options: {
implementation: require('sass'),
sassOptions: {
fiber: false
}
}
}]
}]
}, {
test: /\.css$/,
oneOf: [{
resourceQuery: /module/,
use: [{
loader: 'vue-style-loader'
}, {
loader: 'css-loader',
options: {
modules: true,
esModule: false, // TODO: trueにすると壊れる。Vue3移行の折にはtrueにできるかもしれない
}
}, postcss]
}, {
use: [{
loader: 'vue-style-loader'
}, {
loader: 'css-loader',
options: {
esModule: false, // TODO: trueにすると壊れる。Vue3移行の折にはtrueにできるかもしれない
}
}, postcss]
}]
}, {
test: /\.svg$/,
use: [
'vue-loader',
'vue-svg-loader',
],
}, {
test: /\.(eot|woff|woff2|svg|ttf)([?]?.*)$/,
type: 'asset/resource'
}, {
test: /\.json5$/,
loader: 'json5-loader',
options: {
esModule: false,
},
type: 'javascript/auto'
}, {
test: /\.ts$/,
exclude: /node_modules/,
use: [{
loader: 'ts-loader',
options: {
happyPackMode: true,
transpileOnly: true,
configFile: __dirname + '/tsconfig.json',
appendTsSuffixTo: [/\.vue$/]
}
}]
}]
},
plugins: [
new webpack.ProgressPlugin({}),
new webpack.DefinePlugin({
_VERSION_: JSON.stringify(meta.version),
_LANGS_: JSON.stringify(Object.entries(locales).map(([k, v]) => [k, v._lang_])),
_ENV_: JSON.stringify(process.env.NODE_ENV),
_DEV_: process.env.NODE_ENV !== 'production',
_PERF_PREFIX_: JSON.stringify('Misskey:'),
_DATA_TRANSFER_DRIVE_FILE_: JSON.stringify('mk_drive_file'),
_DATA_TRANSFER_DRIVE_FOLDER_: JSON.stringify('mk_drive_folder'),
_DATA_TRANSFER_DECK_COLUMN_: JSON.stringify('mk_deck_column'),
__VUE_OPTIONS_API__: true,
__VUE_PROD_DEVTOOLS__: false,
}),
new VueLoaderPlugin(),
new WebpackOnBuildPlugin(() => {
fs.mkdirSync(__dirname + '/../../built', { recursive: true });
fs.writeFileSync(__dirname + '/../../built/meta.json', JSON.stringify({ version: meta.version }), 'utf-8');
}),
],
output: {
path: __dirname + '/../../built/_client_dist_',
filename: `[name].${meta.version}.js`,
publicPath: `/assets/`,
pathinfo: false,
},
resolve: {
extensions: [
'.js', '.ts', '.json'
],
alias: {
'@': __dirname + '/src/',
}
},
resolveLoader: {
modules: ['node_modules']
},
experiments: {
topLevelAwait: true
},
devtool: false, //'source-map',
mode: isProduction ? 'production' : 'development'
};

File diff suppressed because it is too large Load Diff