mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-02 10:17:32 -06:00
Merge 4dedd5a575 into 0330722e38
This commit is contained in:
@@ -70,7 +70,7 @@ clean: ## Cleans up everything
|
||||
# Don't use $(NODE) ./node_modules/<path to node_module> as sometimes that's not actually a node script. Instead, rely
|
||||
# on PATH ensuring "node" is found in our distribution first.
|
||||
run: export NODE_ENV=production
|
||||
run: export WEBPACK_ARGS="-p"
|
||||
run: export WEBPACK_ARGS="--node-env=production"
|
||||
run: prereqs webpack ## Runs the site normally
|
||||
./node_modules/.bin/supervisor -w app.js,lib,etc/config,static/tsconfig.json -e 'js|ts|node|properties|yaml' --exec $(NODE) $(NODE_ARGS) -- -r esm ./app.js $(EXTRA_ARGS)
|
||||
|
||||
@@ -84,7 +84,7 @@ debug: prereqs ## Runs the site as a developer with full debugging; including li
|
||||
|
||||
HASH := $(shell git rev-parse HEAD)
|
||||
dist: export NODE_ENV=production
|
||||
dist: export WEBPACK_ARGS=-p
|
||||
dist: export WEBPACK_ARGS="--node-env=production"
|
||||
dist: prereqs webpack ## Creates a distribution
|
||||
echo $(HASH) > out/dist/git_hash
|
||||
|
||||
|
||||
@@ -295,7 +295,6 @@ async function setupWebPackDevMiddleware(router) {
|
||||
const webpackCompiler = webpack(webpackConfig);
|
||||
router.use(webpackDevMiddleware(webpackCompiler, {
|
||||
publicPath: '/static',
|
||||
logger: logger,
|
||||
stats: 'errors-only',
|
||||
}));
|
||||
|
||||
|
||||
Generated
+1592
-4858
File diff suppressed because it is too large
Load Diff
+18
-15
@@ -90,6 +90,8 @@
|
||||
"@types/underscore": "^1.11.4",
|
||||
"@typescript-eslint/eslint-plugin": "^5.7.0",
|
||||
"@typescript-eslint/parser": "^5.7.0",
|
||||
"ajv": "^8.8.2",
|
||||
"ajv-keywords": "^5.1.0",
|
||||
"approvals": "^4.0.0-beta.1",
|
||||
"aws-sdk-mock": "^5.5.0",
|
||||
"chai": "^4.3.4",
|
||||
@@ -97,8 +99,9 @@
|
||||
"chai-http": "^4.2.1",
|
||||
"cheerio": "^1.0.0-rc.10",
|
||||
"codecov": "^3.8.3",
|
||||
"copy-webpack-plugin": "^5.1.2",
|
||||
"css-loader": "^3.6.0",
|
||||
"copy-webpack-plugin": "^9.1.0",
|
||||
"css-loader": "^6.5.1",
|
||||
"css-minimizer-webpack-plugin": "^3.3.0",
|
||||
"deep-equal-in-any-order": "^1.1.15",
|
||||
"eslint": "^8.4.1",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
@@ -110,30 +113,30 @@
|
||||
"eslint-plugin-requirejs": "^4.0.1",
|
||||
"eslint-plugin-sonarjs": "^0.11.0",
|
||||
"eslint-plugin-unicorn": "^39.0.0",
|
||||
"file-loader": "^5.1.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"lint-staged": "^12.1.2",
|
||||
"mini-css-extract-plugin": "^0.9.0",
|
||||
"mini-css-extract-plugin": "^2.4.5",
|
||||
"mocha": "^8.4.0",
|
||||
"mock-fs": "^5.1.2",
|
||||
"monaco-editor-webpack-plugin": "^4.2.0",
|
||||
"nock": "^13.2.1",
|
||||
"nyc": "^15.1.0",
|
||||
"optimize-css-assets-webpack-plugin": "^5.0.8",
|
||||
"path-browserify": "^1.0.1",
|
||||
"prettier": "^2.5.1",
|
||||
"sass": "^1.45.0",
|
||||
"sass-loader": "^10.2.0",
|
||||
"sass-loader": "^12.4.0",
|
||||
"sinon": "^12.0.1",
|
||||
"source-map-loader": "^1.1.3",
|
||||
"source-map-loader": "^3.0.0",
|
||||
"supervisor": "^0.12.0",
|
||||
"terser-webpack-plugin": "^2.3.8",
|
||||
"ts-loader": "^8.3.0",
|
||||
"terser-webpack-plugin": "^5.3.0",
|
||||
"ts-loader": "^9.2.6",
|
||||
"typescript": "^4.5.4",
|
||||
"url-loader": "^3.0.0",
|
||||
"webpack": "^4.46.0",
|
||||
"webpack-cli": "^3.3.12",
|
||||
"webpack-dev-middleware": "^3.7.3",
|
||||
"webpack-dev-server": "^3.11.3",
|
||||
"webpack-manifest-plugin": "^2.2.0"
|
||||
"url-loader": "^4.1.1",
|
||||
"webpack": "^5.65.0",
|
||||
"webpack-cli": "^4.9.1",
|
||||
"webpack-dev-middleware": "^5.3.0",
|
||||
"webpack-dev-server": "^4.6.0",
|
||||
"webpack-manifest-plugin": "^4.0.2"
|
||||
},
|
||||
"mocha": {
|
||||
"require": [
|
||||
|
||||
+30
-38
@@ -22,17 +22,17 @@
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/* eslint-disable node/no-unpublished-import */
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import {fileURLToPath} from 'url';
|
||||
|
||||
/* eslint-disable node/no-unpublished-import */
|
||||
import CopyWebpackPlugin from 'copy-webpack-plugin';
|
||||
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
|
||||
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
||||
import MonacoEditorWebpackPlugin from 'monaco-editor-webpack-plugin';
|
||||
import OptimizeCssAssetsPlugin from 'optimize-css-assets-webpack-plugin';
|
||||
import TerserPlugin from 'terser-webpack-plugin';
|
||||
import webpack from 'webpack';
|
||||
import ManifestPlugin from 'webpack-manifest-plugin';
|
||||
import {WebpackManifestPlugin} from 'webpack-manifest-plugin';
|
||||
|
||||
const __dirname = path.resolve(path.dirname(fileURLToPath(import.meta.url)));
|
||||
const isDev = process.env.NODE_ENV !== 'production';
|
||||
@@ -43,18 +43,20 @@ const staticPath = path.join(distPath, 'static');
|
||||
// Hack alert: due to a variety of issues, sometimes we need to change
|
||||
// the name here. Mostly it's things like webpack changes that affect
|
||||
// how minification is done, even though that's supposed not to matter.
|
||||
const webjackJsHack = '.v4.';
|
||||
const webjackJsHack = '.v5.';
|
||||
const plugins = [
|
||||
new MonacoEditorWebpackPlugin({
|
||||
languages: [ 'cpp', 'go', 'pascal', 'python', 'rust', 'swift', 'java', 'kotlin', 'scala', 'ruby' ],
|
||||
languages: ['cpp', 'go', 'pascal', 'python', 'rust', 'swift', 'java', 'kotlin', 'scala', 'ruby'],
|
||||
filename: isDev ? '[name].worker.js' : `[name]${webjackJsHack}worker.[contenthash].js`,
|
||||
}),
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: 'node_modules/es6-shim/es6-shim.min.js',
|
||||
to: staticPath,
|
||||
},
|
||||
]),
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: 'node_modules/es6-shim/es6-shim.min.js',
|
||||
to: path.join(staticPath, '[name].[contenthash][ext]'),
|
||||
},
|
||||
],
|
||||
}),
|
||||
new webpack.ProvidePlugin({
|
||||
$: 'jquery',
|
||||
jQuery: 'jquery',
|
||||
@@ -62,12 +64,16 @@ const plugins = [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: isDev ? '[name].css' : '[name].[contenthash].css',
|
||||
}),
|
||||
new ManifestPlugin({
|
||||
new WebpackManifestPlugin({
|
||||
fileName: path.join(distPath, 'manifest.json'),
|
||||
publicPath: '',
|
||||
}),
|
||||
];
|
||||
|
||||
if (isDev) {
|
||||
plugins.push(new webpack.HotModuleReplacementPlugin());
|
||||
}
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default {
|
||||
mode: isDev ? 'development' : 'production',
|
||||
@@ -83,8 +89,11 @@ export default {
|
||||
alias: {
|
||||
'monaco-editor$': 'monaco-editor/esm/vs/editor/editor.api',
|
||||
},
|
||||
fallback: {
|
||||
path: 'path-browserify',
|
||||
},
|
||||
modules: ['./static', './node_modules'],
|
||||
extensions: [ '.tsx', '.ts', '.js' ],
|
||||
extensions: ['.tsx', '.ts', '.js'],
|
||||
},
|
||||
stats: 'normal',
|
||||
devtool: 'source-map',
|
||||
@@ -100,18 +109,14 @@ export default {
|
||||
},
|
||||
},
|
||||
},
|
||||
moduleIds: 'hashed',
|
||||
moduleIds: 'deterministic',
|
||||
minimizer: [
|
||||
new OptimizeCssAssetsPlugin({
|
||||
cssProcessorPluginOptions: {
|
||||
preset: ['default', { discardComments: { removeAll: true } }],
|
||||
},
|
||||
}),
|
||||
new CssMinimizerPlugin(),
|
||||
new TerserPlugin({
|
||||
parallel: true,
|
||||
sourceMap: true,
|
||||
terserOptions: {
|
||||
ecma: 5,
|
||||
ecma: 5, sourceMap: true,
|
||||
|
||||
},
|
||||
}),
|
||||
],
|
||||
@@ -119,26 +124,12 @@ export default {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
test: /\.s?css$/,
|
||||
use: [
|
||||
{
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
options: {
|
||||
publicPath: './',
|
||||
hmr: isDev,
|
||||
},
|
||||
},
|
||||
'css-loader',
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.scss$/,
|
||||
use: [
|
||||
{
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
options: {
|
||||
publicPath: './',
|
||||
hmr: isDev,
|
||||
},
|
||||
},
|
||||
'css-loader',
|
||||
@@ -147,7 +138,8 @@ export default {
|
||||
},
|
||||
{
|
||||
test: /\.(png|woff|woff2|eot|ttf|svg)$/,
|
||||
loader: 'url-loader?limit=8192',
|
||||
type: 'asset',
|
||||
parser: {dataUrlCondition: {maxSize: 8192}},
|
||||
},
|
||||
{
|
||||
test: /\.(html)$/,
|
||||
|
||||
Reference in New Issue
Block a user