-
Notifications
You must be signed in to change notification settings - Fork 46
Plugins
A startupjs library might use StartupJS plugin API to simplify its integration into StartupJS projects.
In the library's root folder, create a startupjs.config.cjs
file which should export an object:
module.exports = {
type: 'plugin',
bundler: {
forceCompile: {
web: true,
server: true
}
}
}
The available options are described below:
string
Type of library. Must be plugin
type: 'plugin'
Adjust the bundling and compiling process of startupjs project.
object
Specify whether the library should be force compiled on server and/or web:
bundler: {
forceCompile: {
web: true,
server: true
}
}
You can also pass an array of strings with the library names instead of true
, in this case all of the listed libraries are gonna be force compiled. Note that in this case you also need to specify the library's self name too:
bundler: {
forceCompile: {
web: ['my-startupjs-library', 'react-native-collapsible'],
server: true // this will compile only the library itself (`my-startupjs-library`) on server
}
}
Startupjs plugins which are dependencies of other startupjs plugins gets parsed automatically. Module is considered to be a startupjs plugin if it has startupjs.config.cjs
with at least the following configuration:
module.exports = {
type: 'plugin'
}
So if your module doesn't need to do any special startupjs configuration, but you depend on other startupjs plugins, you still have to create the minimal startupjs.config.cjs
.