Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NodeJS] Update hashing algorithm for webpack #8835

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 40 additions & 39 deletions source/nodejs/adaptivecards-aaf-testapp/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,48 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = (env, argv) => {
const mode = argv.mode || 'development';
const devMode = mode === "development";
const mode = argv.mode || 'development';
const devMode = mode === "development";

console.info('running webpack with mode:', mode);
console.info('running webpack with mode:', mode);

return {
mode: mode,
entry: {
"adaptivecards-aaf-testapp": "./src/app.ts",
},
output: {
path: path.resolve(__dirname, "dist"),
filename: devMode ? "[name].js" : "[name].min.js",
},
resolve: {
extensions: [".ts", ".tsx", ".js"]
},
module: {
rules: [{
test: /\.ts$/,
loader: "ts-loader",
exclude: /(node_modules|__tests__)/
},
{
test: /\.css$/,
use: [
'style-loader',
MiniCssExtractPlugin.loader,
'css-loader'
]
}
]
},
plugins: [
return {
mode: mode,
entry: {
"adaptivecards-aaf-testapp": "./src/app.ts",
},
output: {
path: path.resolve(__dirname, "dist"),
hashFunction: "xxhash64",
filename: devMode ? "[name].js" : "[name].min.js",
},
resolve: {
extensions: [".ts", ".tsx", ".js"]
},
module: {
rules: [{
test: /\.ts$/,
loader: "ts-loader",
exclude: /(node_modules|__tests__)/
},
{
test: /\.css$/,
use: [
'style-loader',
MiniCssExtractPlugin.loader,
'css-loader'
]
}
]
},
plugins: [
new HtmlWebpackPlugin({
title: "AAF JavaScript Runtime test application",
template: "./index.html"
}),
title: "AAF JavaScript Runtime test application",
template: "./index.html"
}),
new MiniCssExtractPlugin({
filename: '[name].css'
})
]
}
filename: '[name].css'
})
]
}
}
115 changes: 58 additions & 57 deletions source/nodejs/adaptivecards-controls/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,64 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");

module.exports = (env, argv) => {
const mode = argv.mode || 'development';
const devMode = mode === "development";
const mode = argv.mode || 'development';
const devMode = mode === "development";

console.info('running webpack with mode:', mode);
console.info('running webpack with mode:', mode);

return {
mode: mode,
entry: {
"adaptivecards-controls": "./src/adaptivecards-controls.ts",
},
output: {
path: path.resolve(__dirname, "./dist"),
filename: devMode ? "[name].js" : "[name].min.js",
libraryTarget: "umd",
library: "ACControls",
umdNamedDefine: true,
publicPath: "/dist/",
globalObject: "this"
},
devtool: devMode ? "inline-source-map" : "source-map",
resolve: {
extensions: [".ts", ".tsx", ".js"]
},
module: {
rules: [
{
test: /\.ts$/,
loader: "ts-loader",
exclude: /(node_modules|__tests__)/
},
{
test: /\.css$/,
use: [
'style-loader',
MiniCssExtractPlugin.loader,
'css-loader'
]
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: 'adaptivecards-controls.css',
}),
new CopyWebpackPlugin({
patterns: [{
from: 'src/adaptivecards-controls.css',
to: '../lib/[name][ext]'
},
{
from: 'src/adaptivecards-controls.css',
to: '../dist/[name][ext]'
}],
options: {
concurrency: 8
}
})
]
};
return {
mode: mode,
entry: {
"adaptivecards-controls": "./src/adaptivecards-controls.ts",
},
output: {
path: path.resolve(__dirname, "./dist"),
filename: devMode ? "[name].js" : "[name].min.js",
hashFunction: "xxhash64",
libraryTarget: "umd",
library: "ACControls",
umdNamedDefine: true,
publicPath: "/dist/",
globalObject: "this"
},
devtool: devMode ? "inline-source-map" : "source-map",
resolve: {
extensions: [".ts", ".tsx", ".js"]
},
module: {
rules: [
{
test: /\.ts$/,
loader: "ts-loader",
exclude: /(node_modules|__tests__)/
},
{
test: /\.css$/,
use: [
'style-loader',
MiniCssExtractPlugin.loader,
'css-loader'
]
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: 'adaptivecards-controls.css',
}),
new CopyWebpackPlugin({
patterns: [{
from: 'src/adaptivecards-controls.css',
to: '../lib/[name][ext]'
},
{
from: 'src/adaptivecards-controls.css',
to: '../dist/[name][ext]'
}],
options: {
concurrency: 8
}
})
]
};
};
133 changes: 67 additions & 66 deletions source/nodejs/adaptivecards-designer-app/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,72 +5,73 @@ const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');

module.exports = (env, argv) => {
const mode = argv.mode || 'development';
const devMode = mode === "development";
const mode = argv.mode || 'development';
const devMode = mode === "development";

console.info('running webpack with mode:', mode);
console.info('running webpack with mode:', mode);

return {
mode: mode,
entry: {
"adaptivecards-designer-app": "./src/app.ts",
},
output: {
path: path.resolve(__dirname, "dist"),
filename: devMode ? "[name].js" : "[name].min.js",
},
resolve: {
extensions: [".ts", ".tsx", ".js"]
},
module: {
rules: [
{
test: /\.ts$/,
loader: "ts-loader",
exclude: /(node_modules|__tests__)/
},
{
test: /\.ttf$/,
loader: "file-loader"
},
{
test: /\.css$/,
use: [
devMode ? 'style-loader' : MiniCssExtractPlugin.loader,
'css-loader'
]
},
{
test: /\.svg$/,
type: 'asset/resource'
}
]
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{
from: 'node_modules/adaptivecards-designer/src/containers/**/*',
to: 'containers/[name][ext]'
},
{
// the designer expects to find its CSS here. an alternative for a consumer would
// be to make sure they load it themselves.
from: 'node_modules/adaptivecards-designer/dist/adaptivecards-designer.css',
to: 'adaptivecards-designer.css'
}
]
}),
new HtmlWebpackPlugin({
title: "Adaptive Cards Designer",
template: "./index.html"
}),
new MiniCssExtractPlugin({
filename: '[name].css'
}),
new MonacoWebpackPlugin({
languages: ['json']
})
]
}
return {
mode: mode,
entry: {
"adaptivecards-designer-app": "./src/app.ts",
},
output: {
path: path.resolve(__dirname, "dist"),
hashFunction: "xxhash64",
filename: devMode ? "[name].js" : "[name].min.js",
},
resolve: {
extensions: [".ts", ".tsx", ".js"]
},
module: {
rules: [
{
test: /\.ts$/,
loader: "ts-loader",
exclude: /(node_modules|__tests__)/
},
{
test: /\.ttf$/,
loader: "file-loader"
},
{
test: /\.css$/,
use: [
devMode ? 'style-loader' : MiniCssExtractPlugin.loader,
'css-loader'
]
},
{
test: /\.svg$/,
type: 'asset/resource'
}
]
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{
from: 'node_modules/adaptivecards-designer/src/containers/**/*',
to: 'containers/[name][ext]'
},
{
// the designer expects to find its CSS here. an alternative for a consumer would
// be to make sure they load it themselves.
from: 'node_modules/adaptivecards-designer/dist/adaptivecards-designer.css',
to: 'adaptivecards-designer.css'
}
]
}),
new HtmlWebpackPlugin({
title: "Adaptive Cards Designer",
template: "./index.html"
}),
new MiniCssExtractPlugin({
filename: '[name].css'
}),
new MonacoWebpackPlugin({
languages: ['json']
})
]
}
}
Loading
Loading