frosty 0.0.101 → 0.0.103

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,6 +26,9 @@
26
26
 
27
27
  set -e
28
28
 
29
+ # Get current working directory
30
+ export INIT_CWD="$( realpath "${INIT_CWD:-$(pwd)}" )"
31
+
29
32
  SCRIPT_DIR="$( dirname $( realpath "${BASH_SOURCE[0]}" ) )"
30
33
  cd "$SCRIPT_DIR"
31
34
 
@@ -8,23 +8,25 @@
8
8
  "frosty": "./bin/frosty.sh"
9
9
  },
10
10
  "dependencies": {
11
- "@babel/core": "^7.24.5",
12
- "@babel/preset-env": "^7.24.5",
11
+ "@babel/core": "^7.28.4",
12
+ "@babel/preset-env": "^7.28.3",
13
13
  "@babel/preset-react": "^7.26.3",
14
14
  "@babel/preset-typescript": "^7.24.1",
15
15
  "@o2ter/server-js": "^0.0.21",
16
- "babel-jest": "^30.0.5",
16
+ "babel-jest": "^30.1.2",
17
17
  "babel-loader": "^10.0.0",
18
- "core-js": "^3.45.0",
18
+ "core-js": "^3.45.1",
19
19
  "css-loader": "^7.1.2",
20
20
  "dotenv-webpack": "^8.1.1",
21
21
  "file-loader": "^6.2.0",
22
- "mini-css-extract-plugin": "^2.9.3",
22
+ "mini-css-extract-plugin": "^2.9.4",
23
23
  "node-loader": "^2.1.0",
24
- "postcss-loader": "^8.1.1",
25
- "sass": "^1.90.0",
24
+ "postcss-loader": "^8.2.0",
25
+ "sass": "^1.92.1",
26
26
  "sass-loader": "^16.0.5",
27
27
  "terser-webpack-plugin": "^5.3.14",
28
- "webpack": "^5.101.0"
28
+ "webpack": "^5.101.2",
29
+ "webpack-cli": "^6.0.1",
30
+ "webpack-node-externals": "^3.0.0"
29
31
  }
30
32
  }
@@ -112,9 +112,9 @@ if [ "$NO_BUILD" != "true" ]; then
112
112
  [ -n "$SRCROOT" ] && BUILD_OPTS="$BUILD_OPTS --env SRCROOT="$SRCROOT""
113
113
  [ -n "$PORT" ] && BUILD_OPTS="$BUILD_OPTS --env PORT="$PORT""
114
114
  if [ "$WATCH_MODE" = "true" ]; then
115
- npx webpack-cli $BUILD_OPTS --watch &
115
+ node "$FROSTY_CLI_ROOT/node_modules/webpack-cli/bin/cli.js" $BUILD_OPTS --watch &
116
116
  else
117
- npx webpack-cli $BUILD_OPTS
117
+ node "$FROSTY_CLI_ROOT/node_modules/webpack-cli/bin/cli.js" $BUILD_OPTS
118
118
  fi
119
119
  fi
120
120
 
@@ -31,6 +31,7 @@ import crypto from 'crypto';
31
31
  import webpack from 'webpack';
32
32
  import Dotenv from 'dotenv-webpack';
33
33
  import TerserPlugin from 'terser-webpack-plugin';
34
+ import nodeExternals from 'webpack-node-externals';
34
35
  import MiniCssExtractPlugin from 'mini-css-extract-plugin';
35
36
 
36
37
  const { dirname: __dirname } = import.meta;
@@ -112,13 +113,6 @@ export default async (env, argv) => {
112
113
  path.resolve(__dirname, 'node_modules/css-loader'),
113
114
  {
114
115
  loader: path.resolve(__dirname, 'node_modules/postcss-loader'),
115
- options: {
116
- postcssOptions: {
117
- plugins: [
118
- 'autoprefixer',
119
- ],
120
- }
121
- }
122
116
  },
123
117
  path.resolve(__dirname, 'node_modules/sass-loader'),
124
118
  ].filter(Boolean),
@@ -187,18 +181,18 @@ export default async (env, argv) => {
187
181
  externals: config.options?.externals,
188
182
  };
189
183
 
190
- const webpackPlugins = [
184
+ const webpackPlugins = _.compact([
191
185
  new MiniCssExtractPlugin({ filename: 'css/[name].css' }),
192
186
  new webpack.DefinePlugin({ __DEV__: JSON.stringify(!IS_PRODUCTION) }),
193
- new Dotenv({ path: path.join(process.cwd(), '.env') }),
194
- new Dotenv({ path: path.join(process.cwd(), '.env.local') }),
187
+ fs.existsSync(path.join(process.cwd(), '.env')) && new Dotenv({ path: path.join(process.cwd(), '.env') }),
188
+ fs.existsSync(path.join(process.cwd(), '.env.local')) && new Dotenv({ path: path.join(process.cwd(), '.env.local') }),
195
189
  new webpack.ProvidePlugin({
196
190
  _: 'lodash',
197
191
  }),
198
192
  ...config.options?.plugins ?? [],
199
- ];
193
+ ]);
200
194
 
201
- const server = config.serverEntry ? path.resolve(process.cwd(), config.serverEntry) : path.resolve(__dirname, './src/server/default.ts');
195
+ const server = config.serverEntry ? path.resolve(process.cwd(), config.serverEntry) : path.resolve(__dirname, 'src/server/default.ts');
202
196
 
203
197
  const random = crypto.randomUUID();
204
198
  const tempDir = fs.mkdtempSync(`${os.tmpdir()}${path.sep}`);
@@ -223,7 +217,7 @@ export default async (env, argv) => {
223
217
  entry: {
224
218
  [`${name}_bundle`]: [
225
219
  path.resolve(__dirname, 'node_modules/core-js/stable'),
226
- path.resolve(__dirname, './src/client/index.js'),
220
+ path.resolve(__dirname, 'src/client/index.js'),
227
221
  ],
228
222
  },
229
223
  output: {
@@ -268,7 +262,7 @@ export default async (env, argv) => {
268
262
  entry: {
269
263
  server: [
270
264
  path.resolve(__dirname, 'node_modules/core-js/stable'),
271
- path.resolve(__dirname, './src/server/index.js'),
265
+ path.resolve(__dirname, 'src/server/index.js'),
272
266
  ],
273
267
  },
274
268
  output: {
@@ -287,6 +281,10 @@ export default async (env, argv) => {
287
281
  '...'
288
282
  ],
289
283
  },
284
+ externals: [
285
+ ...webpackConfiguration.externals || [],
286
+ nodeExternals(),
287
+ ],
290
288
  module: {
291
289
  rules: [
292
290
  babelLoaderConfiguration({ server: true }),