-
Notifications
You must be signed in to change notification settings - Fork 20
Config
TANIGUCHI Masaya edited this page Nov 6, 2017
·
2 revisions
Put s2s.config.js
into your project's root.
s2s requires you to set watch
and plugins
, templates
.
module.exports = {
watch: './**/*.js', // string
plugins: [],
templates: [],
}
You can use Glob in this section to set targets.
Set the array of the objects.
You have to set test
and plugin
.
-
test
requires you to set targets with regular expression. -
plugin
allows you, same as.babelrc
, to set the name of plugin and the array of options you wants.
type EventType = 'add' | 'change' | 'unlink'
type Only = EventType[]
type PluginOpts = PluginName | [PluginName, Object]
type Plugin = {|
test: RegExp,
plugin: PluginOpts,
only?: Only,
input?: FileName,
output?: FileName,
|}
Copy a template from files.
the template requires you to set test
and input
.
-
test
requires you, same as plugins, to set paths to files with regular expression. -
input
requires you to set the file in thetemplate
directory.
type Template = {|
test: RegExp,
input: Path,
output?: Path,
|}