You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BREAKING CHANGE: Introduced vulcan.config.js and changing the way to read the entry point of the preset files and the application entrypoint. No longer use the "main()" function as input, but the function that is exported as default "export default foo()".
Copy file name to clipboardexpand all lines: README.md
+93-1
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,98 @@ See some examples below:
81
81
vulcan dev
82
82
```
83
83
84
+
## Vulcan.config.js
85
+
86
+
The `vulcan.config.js` file offers a robust configuration system for Vulcan. This file is not mandatory but acts as an override mechanism. If you define properties in this file, they will supersede the preset configurations. Properties not defined will rely on the preset.
87
+
88
+
Here's a detailed breakdown of the configuration properties available in `vulcan.config.js`:
89
+
90
+
### Entry
91
+
92
+
**Type:** String
93
+
94
+
**Description:**
95
+
This represents the primary entry point for your application, where the building process begins.
96
+
97
+
**Note:**`Entry` will be ignored for jamstack solutions.
98
+
99
+
### Builder
100
+
101
+
**Type:** String ('esbuild' or 'webpack')
102
+
103
+
**Description:**
104
+
Defines which build tool to use. The available options are `esbuild` and `webpack`.
105
+
106
+
### UseNodePolyfills
107
+
108
+
**Type:** Boolean
109
+
110
+
**Description:**
111
+
Determines if Node.js polyfills should be applied. This is useful for projects that leverage Node.js specific functionalities but are targeting environments without such built-in capabilities.
112
+
113
+
### UseOwnWorker
114
+
115
+
**Type:** Boolean
116
+
117
+
**Description:**
118
+
This flag indicates that the constructed code inserts its own worker expression, such as `addEventListener("fetch")` or similar, without the need to inject a provider.
119
+
120
+
### Preset
121
+
122
+
**Type:** Object
123
+
124
+
**Description:**
125
+
Provides preset-specific configurations.
126
+
127
+
-**Name (Type: String):** Refers to the preset name, e.g., "vue" or "next".
128
+
-**Mode (Type: String):** Specifies the mode for the preset, e.g., "compute" or "deliver".
129
+
130
+
### MemoryFS
131
+
132
+
**Type:** Object
133
+
134
+
**Description:**
135
+
Configurations related to the in-memory filesystem.
136
+
137
+
-**InjectionDirs (Type: Array of Strings):** Directories to be injected into memory for runtime access via the fs API.
138
+
139
+
-**RemovePathPrefix (Type: String):** A prefix path to be removed from files before injecting into memory.
140
+
141
+
### Custom
142
+
143
+
**Type:** Object
144
+
145
+
**Description:**
146
+
Allows you to extend the capabilities of the chosen bundler (either `webpack` or `esbuild`) with custom plugins or configurations.
147
+
148
+
-**Plugins (Type: Object):** Add your custom plugins for your chosen bundler here.
149
+
150
+
### Example Configuration
151
+
152
+
For a Vue-based project:
153
+
154
+
```javascript
155
+
module.exports= {
156
+
entry:'src/index.js',
157
+
builder:'webpack',
158
+
useNodePolyfills:true,
159
+
useOwnWorker:false,
160
+
preset: {
161
+
name:'vue',
162
+
mode:'compute',
163
+
},
164
+
memoryFS: {
165
+
injectionDirs: ['.faststore/@generated/graphql'],
166
+
removePathPrefix:'.faststore/',
167
+
},
168
+
custom: {
169
+
plugins: {},
170
+
},
171
+
};
172
+
```
173
+
174
+
**Note:** Adapting `vulcan.config.js` to your setup allows a personalized development experience, catering to the specific needs of your JavaScript applications and frameworks.
175
+
84
176
## Docs
85
177
86
178
-[Overview](docs/overview.md)
@@ -92,7 +184,7 @@ Check the [Contributing doc](CONTRIBUTING.md).
0 commit comments