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

webpack improvements #998

Merged
merged 3 commits into from
Oct 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
2 changes: 1 addition & 1 deletion jest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ module.exports = {
"\\.[t|j]sx?$": [
"babel-jest",
{
...require("../babel").env.test,
cwd: process.env.INIT_CWD,
babelrc: false,
sourceMaps: "inline",
...require("../babel").env.test,
},
],
"\\.css$": path.resolve(__dirname, "transform", "css.js"),
Expand Down
1,251 changes: 628 additions & 623 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lastui/rocker",
"version": "0.20.39",
"version": "0.20.40",
"license": "Apache-2.0",
"author": "jan.cajthaml@gmail.com",
"homepage": "https://github.com/lastui/rocker#readme",
Expand Down Expand Up @@ -50,16 +50,16 @@
"test:platform": "node ./cli/index.js test --cwd=platform"
},
"dependencies": {
"@babel/core": "7.25.8",
"@babel/eslint-parser": "7.25.8",
"@babel/parser": "7.25.8",
"@babel/plugin-proposal-export-default-from": "7.25.8",
"@babel/plugin-proposal-throw-expressions": "7.25.8",
"@babel/plugin-transform-modules-commonjs": "7.25.7",
"@babel/preset-env": "7.25.8",
"@babel/preset-react": "7.25.7",
"@babel/preset-typescript": "7.25.7",
"@babel/register": "7.25.7",
"@babel/core": "7.25.9",
"@babel/eslint-parser": "7.25.9",
"@babel/parser": "7.25.9",
"@babel/plugin-proposal-export-default-from": "7.25.9",
"@babel/plugin-proposal-throw-expressions": "7.25.9",
"@babel/plugin-transform-modules-commonjs": "7.25.9",
"@babel/preset-env": "7.25.9",
"@babel/preset-react": "7.25.9",
"@babel/preset-typescript": "7.25.9",
"@babel/register": "7.25.9",
"@linaria/core": "6.2.0",
"@linaria/postcss-linaria": "6.2.0",
"@linaria/react": "6.2.1",
Expand All @@ -78,7 +78,7 @@
"eslint-plugin-import": "2.31.0",
"eslint-plugin-react": "7.37.1",
"globals": "15.11.0",
"html-webpack-plugin": "5.6.2",
"html-webpack-plugin": "5.6.3",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"json5-loader": "4.0.1",
Expand Down
2 changes: 1 addition & 1 deletion webpack/config/module/development.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const settings = require("../../settings");

setLogLevel("none");

const linariaBabel = babel.env.development;
const webpackBabel = babel.env.development;
const linariaBabel = babel.env.test;

module.exports = merge(require("../../internal/base.js"), require("../../internal/development.js"), {
resolve: {
Expand Down
2 changes: 1 addition & 1 deletion webpack/config/module/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const ModuleLocalesPlugin = require("../../plugins/ModuleLocalesPlugin");
const SoftwareBillOfMaterialsPlugin = require("../../plugins/SoftwareBillOfMaterialsPlugin");
const settings = require("../../settings");

const linariaBabel = babel.env.development;
const webpackBabel = babel.env.production;
const linariaBabel = babel.env.test;

module.exports = merge(require("../../internal/base.js"), require("../../internal/build.js"), {
resolve: {
Expand Down
2 changes: 1 addition & 1 deletion webpack/config/spa/development.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const ImplicitDLLAssetPlugin = require("../../plugins/ImplicitDLLAssetPlugin");

setLogLevel("none");

const linariaBabel = babel.env.development;
const webpackBabel = babel.env.development;
const linariaBabel = babel.env.test;

module.exports = merge(require("../../internal/base.js"), require("../../internal/development.js"), {
resolve: {
Expand Down
2 changes: 1 addition & 1 deletion webpack/config/spa/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const ImplicitDLLAssetPlugin = require("../../plugins/ImplicitDLLAssetPlugin");
const SoftwareBillOfMaterialsPlugin = require("../../plugins/SoftwareBillOfMaterialsPlugin");
const settings = require("../../settings");

const linariaBabel = babel.env.test;
const linariaBabel = babel.env.development;
const webpackBabel = babel.env.production;

module.exports = merge(require("../../internal/base.js"), require("../../internal/build.js"), {
Expand Down
2 changes: 2 additions & 0 deletions webpack/internal/base.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require("path");
const webpack = require("webpack");

const NormalizedModuleIdPlugin = require("../plugins/NormalizedModuleIdPlugin");
const settings = require("../settings");

module.exports = {
Expand Down Expand Up @@ -44,6 +45,7 @@ module.exports = {
managedPaths: [path.resolve(process.env.INIT_CWD, "node_modules")],
},
plugins: [
new NormalizedModuleIdPlugin(),
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
process: ["process"],
Expand Down
7 changes: 1 addition & 6 deletions webpack/internal/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const path = require("path");
const TerserPlugin = require("terser-webpack-plugin");
const webpack = require("webpack");

const NormalizedModuleIdPlugin = require("../plugins/NormalizedModuleIdPlugin");
const settings = require("../settings");

module.exports = {
Expand Down Expand Up @@ -61,11 +60,9 @@ module.exports = {
sourceMap: false,
toplevel: false,
parse: {
ecma: 2023,
html5_comments: false,
},
compress: {
ecma: 2023,
warnings: false,
comparisons: false,
inline: 2,
Expand All @@ -75,8 +72,7 @@ module.exports = {
dead_code: true,
drop_debugger: true,
},
output: {
ecma: 2023,
format: {
comments: false,
ascii_only: true,
indent_level: 0,
Expand All @@ -88,7 +84,6 @@ module.exports = {
],
},
plugins: [
new NormalizedModuleIdPlugin(),
...(settings.PROGRESS
? [
new webpack.ProgressPlugin({
Expand Down