mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 06:55:08 -04:00
Merge remote-tracking branch 'upstream/master' into features/rsa
This commit is contained in:
commit
841e760b04
593 changed files with 53203 additions and 8470 deletions
|
@ -1,5 +1,7 @@
|
|||
const webpack = require("webpack");
|
||||
const ExtractTextPlugin = require("extract-text-webpack-plugin");
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
||||
const path = require("path");
|
||||
|
||||
/**
|
||||
* Webpack configuration details for use with Grunt.
|
||||
|
@ -30,6 +32,7 @@ const banner = `/**
|
|||
* limitations under the License.
|
||||
*/`;
|
||||
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
new webpack.ProvidePlugin({
|
||||
|
@ -42,20 +45,37 @@ module.exports = {
|
|||
raw: true,
|
||||
entryOnly: true
|
||||
}),
|
||||
new ExtractTextPlugin("styles.css")
|
||||
new webpack.DefinePlugin({
|
||||
"process.browser": "true"
|
||||
}),
|
||||
new MiniCssExtractPlugin({
|
||||
filename: "assets/[name].css"
|
||||
}),
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
context: "src/core/vendor/",
|
||||
from: "tesseract/**/*",
|
||||
to: "assets/"
|
||||
}
|
||||
])
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
jquery: "jquery/src/jquery"
|
||||
}
|
||||
jquery: "jquery/src/jquery",
|
||||
},
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.m?js$/,
|
||||
exclude: /node_modules\/(?!jsesc|crypto-api)/,
|
||||
exclude: /node_modules\/(?!jsesc|crypto-api|bootstrap)/,
|
||||
options: {
|
||||
configFile: path.resolve(__dirname, "babel.config.js"),
|
||||
cacheDirectory: true,
|
||||
compact: false
|
||||
},
|
||||
type: "javascript/auto",
|
||||
loader: "babel-loader?compact=false"
|
||||
loader: "babel-loader"
|
||||
},
|
||||
{
|
||||
test: /forge.min.js$/,
|
||||
|
@ -71,43 +91,76 @@ module.exports = {
|
|||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
use: [
|
||||
{ loader: "css-loader" },
|
||||
{ loader: "postcss-loader" },
|
||||
]
|
||||
})
|
||||
use: [
|
||||
{
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
options: {
|
||||
publicPath: "../"
|
||||
}
|
||||
},
|
||||
"css-loader",
|
||||
"postcss-loader",
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.scss$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
use: [
|
||||
{ loader: "css-loader" },
|
||||
{ loader: "sass-loader" }
|
||||
]
|
||||
})
|
||||
use: [
|
||||
{
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
options: {
|
||||
publicPath: "../"
|
||||
}
|
||||
},
|
||||
"css-loader",
|
||||
"sass-loader",
|
||||
]
|
||||
},
|
||||
/**
|
||||
* The limit for these files has been increased to 60,000 (60KB)
|
||||
* to ensure the material icons font is inlined.
|
||||
*
|
||||
* See: https://github.com/gchq/CyberChef/issues/612
|
||||
*/
|
||||
{
|
||||
test: /\.(ico|eot|ttf|woff|woff2)$/,
|
||||
loader: "url-loader",
|
||||
options: {
|
||||
limit: 10000
|
||||
limit: 60000,
|
||||
name: "[hash].[ext]",
|
||||
outputPath: "assets"
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.svg$/,
|
||||
loader: "svg-url-loader",
|
||||
options: {
|
||||
encoding: "base64"
|
||||
}
|
||||
},
|
||||
{ // Store font .fnt and .png files in a separate fonts folder
|
||||
test: /(\.fnt$|bmfonts\/.+\.png$)/,
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
name: "[name].[ext]",
|
||||
outputPath: "assets/fonts"
|
||||
}
|
||||
},
|
||||
{ // First party images are saved as files to be cached
|
||||
test: /\.(png|jpg|gif|svg)$/,
|
||||
exclude: /node_modules/,
|
||||
test: /\.(png|jpg|gif)$/,
|
||||
exclude: /(node_modules|bmfonts)/,
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
name: "images/[name].[ext]"
|
||||
}
|
||||
},
|
||||
{ // Third party images are inlined
|
||||
test: /\.(png|jpg|gif|svg)$/,
|
||||
test: /\.(png|jpg|gif)$/,
|
||||
exclude: /web\/static/,
|
||||
loader: "url-loader",
|
||||
options: {
|
||||
limit: 10000
|
||||
limit: 10000,
|
||||
name: "[hash].[ext]",
|
||||
outputPath: "assets"
|
||||
}
|
||||
},
|
||||
]
|
||||
|
@ -117,10 +170,18 @@ module.exports = {
|
|||
chunks: false,
|
||||
modules: false,
|
||||
entrypoints: false,
|
||||
warningsFilter: [/source-map/, /dependency is an expression/],
|
||||
warningsFilter: [
|
||||
/source-map/,
|
||||
/dependency is an expression/,
|
||||
/export 'default'/,
|
||||
/Can't resolve 'sodium'/
|
||||
],
|
||||
},
|
||||
node: {
|
||||
fs: "empty"
|
||||
fs: "empty",
|
||||
"child_process": "empty",
|
||||
net: "empty",
|
||||
tls: "empty"
|
||||
},
|
||||
performance: {
|
||||
hints: false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue