frosty 0.0.72 → 0.0.74

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.
package/README.md CHANGED
@@ -73,19 +73,43 @@ npx frosty run --port 3000 --configuration my.config.js app.js
73
73
 
74
74
  See `npx frosty run --help` for the full list of options.
75
75
 
76
- ### Configuration File
76
+ ### Configuration File (Optional)
77
77
 
78
- You can customize the build and server behavior by providing a `server.config.js` file in your project root. This file can export an object or a function that returns configuration options for Frosty’s CLI and build process. Common settings include specifying source/output directories, custom plugins, module rules, and server options.
78
+ Customize build and server behavior with a `server.config.js` file in your project root.
79
79
 
80
- Example `server.config.js`:
80
+ - You may export an object or a function `(env, argv) => config`.
81
+ - All fields are optional.
81
82
 
82
83
  ```js
83
84
  module.exports = {
84
- src: 'src',
85
- output: 'dist',
86
- serverEntry: 'server.js',
87
- options: {
88
- // custom webpack or build options
85
+ src: 'src', // Source directory
86
+ output: 'dist', // Output directory
87
+ serverEntry: 'server.js', // Server entry file
88
+ client: { // (Optional) Client entry points
89
+ main: {
90
+ entry: 'src/app.js', // Path to client entry file
91
+ uri: '/', // (Optional) URI path
92
+ basename: '/' // (Optional) Basename
93
+ }
94
+ },
95
+ moduleSuffixes: { // (Optional) Custom module resolution suffixes
96
+ client: ['.browser', '.web', ''],
97
+ server: ['.node', '.server', '.web', '']
98
+ },
99
+ polyfills: {}, // (Optional) Polyfill options for Babel
100
+ options: { // (Optional) Webpack and build options
101
+ resolve: {}, // Custom resolve options (e.g., alias)
102
+ externals: {}, // Webpack externals
103
+ plugins: [], // Additional Webpack plugins
104
+ module: {
105
+ rules: [] // Additional Webpack module rules
106
+ },
107
+ server: {
108
+ plugins: [], // Server-specific plugins
109
+ module: {
110
+ rules: [] // Server-specific module rules
111
+ }
112
+ }
89
113
  }
90
114
  };
91
115
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frosty",
3
- "version": "0.0.72",
3
+ "version": "0.0.74",
4
4
  "main": "dist/index",
5
5
  "module": "dist/index",
6
6
  "types": "dist/index",
@@ -77,7 +77,7 @@ done
77
77
  set -- "${POSITIONAL_ARGS[@]}"
78
78
 
79
79
  if [ $# -gt 0 ]; then
80
- INPUT_FILE="$1"
80
+ INPUT_FILE="$1"; shift ;
81
81
  fi
82
82
 
83
83
  CONFIG_FILE="${CONFIG_FILE:-"$PROJECT_ROOT/server.config.js"}"
@@ -101,7 +101,7 @@ if [ "$NO_BUILD" != "true" ]; then
101
101
  fi
102
102
 
103
103
  if [ "$BUILD_ONLY" != "true" ] && [ "$WATCH_MODE" = "true" ]; then
104
- until [ -f "$OUTPUT_DIR/server.js" ]; do sleep 1; done && npx nodemon --watch "$OUTPUT_DIR" "$OUTPUT_DIR/server.js" &
104
+ until [ -f "$OUTPUT_DIR/server.js" ]; do sleep 1; done && npx nodemon --watch "$OUTPUT_DIR" "$OUTPUT_DIR/server.js" $@ &
105
105
  fi
106
106
 
107
107
  if [ "$NO_BUILD" != "true" ]; then
@@ -125,5 +125,5 @@ fi
125
125
  if [ "$WATCH_MODE" = "true" ]; then
126
126
  wait
127
127
  elif [ ! $BUILD_ONLY ]; then
128
- node "$OUTPUT_DIR/server.js"
128
+ node "$OUTPUT_DIR/server.js" $@
129
129
  fi