-
-
Notifications
You must be signed in to change notification settings - Fork 50
/
.live-css.config.js
144 lines (117 loc) · 8.98 KB
/
.live-css.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/*
This configuration file is used for running "live-css" server (https://www.npmjs.com/package/@webextensions/live-css)
It is meant to be used along with browser extension "Live editor for CSS, Less & Sass - Magic CSS":
https://github.com/webextensions/live-css-editor
To generate this file, download and install Node JS from https://nodejs.org/en/download/
After that:
$ npm install -g @webextensions/live-css
$ cd <project-folder>
$ live-css --init
--------OR--------
Copy the default configuration file from:
https://github.com/webextensions/live-css-editor/tree/master/live-css/default.live-css.config.js
and save it as a file with name ".live-css.config.js" (note that the file name begins with a dot character)
For further guidance, visit the following links:
https://www.npmjs.com/package/@webextensions/live-css
https://github.com/webextensions/live-css-editor/tree/master/live-css
https://github.com/webextensions/live-css-editor
https://github.com/webextensions/live-css-editor/issues
*/
/* eslint-env node */ // https://eslint.org/docs/rules/no-undef#nodejs
module.exports = { // Learn more about "module.exports":
// https://www.sitepoint.com/understanding-module-exports-exports-node-js/
// http://www.tutorialsteacher.com/nodejs/nodejs-module-exports
// http://stackabuse.com/how-to-use-module-exports-in-node-js/
// https://nodejs.org/api/modules.html#modules_module_exports
// The "port" configuration option is used as a suggested port number when the live-css server needs to run
// on a separate port of its own. If the specified port is busy, the next available port may be used.
// It will be used when:
// - you run live-css from command-line
// - you run live-css in a Node JS project using require() syntax, but do not pass the "httpServer" option
"port": 4567, // Recommended value: A number between 1024 and 49151
// The "live-css" server would start at this port number
// Learn more about ports:
// https://computer.howstuffworks.com/web-server8.htm
// https://en.wikipedia.org/wiki/Registered_port
"edit-file-patterns": [
"**/*.css",
"**/*.less",
"**/*.sass",
"**/*.scss",
"**/*.styl",
"**/*.stylus"
],
"edit-file-ignore-patterns": [
// Some of the common folders in various projects which you may wish to exclude
/(^|[/\\])\../, // This regular expression ignores the files/directories having name beginning with "." character
// Learn more about regular expressions:
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
"node_modules",
".npm",
"logs",
"temp",
"tmp",
"!node_modules/package/do-not-ignore.css"
],
// IMPORTANT NOTE: Setting "root" to an incorrect value may result in failure to auto-refresh styles in the browser.
// If you are in doubt, don't use the "root" configuration option, live-css would still work fine.
// Keeping "root" configuration option as commented out by default
// "root": ".", // <relative-or-absolute-path>
// This path should point to the root ("/") of your web server for which you are using live-css.
// For example,
// If http://localhost/ points to /path/to/project/http-pub/
// And this configuration file is placed at /path/to/project/
// Then, you may use "root": "http-pub" <OR> "root": "/path/to/project/http-pub"
// This is the root folder which contains the files you wish to watch for changes
// This folder would be scanned recursively for files matching the "watch-patterns"
// while skipping the files matching the "watch-ignore-patterns"
// If you are setting "root" with a relative path value, then keep that path value
// as relative to this configuration file.
// Learn more:
// https://en.wikipedia.org/wiki/Path_(computing)
"watch-patterns": [ // <Array/String/RegExp/Function>
// Glob patterns or paths of files and directories to be watched recursively
// Learn more:
// https://www.npmjs.com/package/anymatch
// https://github.com/paulmillr/chokidar#api ("paths" property)
// https://en.wikipedia.org/wiki/Path_(computing)
"**/*.css" // Include all the ".css" files to watch for changes
],
"watch-ignore-patterns": [ // <Array/String/RegExp/Function>
// Glob patterns or paths of files and directories to be ignored from being watched
// Learn more:
// https://www.npmjs.com/package/anymatch
// https://github.com/paulmillr/chokidar#path-filtering ("ignored" property)
// Some of the common folders in various projects which you may wish to exclude
/(^|[/\\])\../, // This regular expression ignores the files/directories having name beginning with "." character
// Learn more about regular expressions:
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
"node_modules",
".npm",
"logs",
"temp",
"tmp",
// "Negate" pattern (by using "!" symbol) to cancel ignore rule
// An example path which is required to be watched, but its parent folder is ignored
// **** IMPORTANT NOTE:
// **** For watching, this path would also need to be included in the "watch-patterns" section (without the "!" symbol)
"!node_modules/package/do-not-ignore.css" // The "!" symbol in the beginning negates the matching pattern from the "watch-ignore-patterns". It means that
// the file matching this pattern would not be ignored even though "node_modules" is marked to be ignored.
// Learn more:
// https://github.com/isaacs/minimatch/blob/master/README.md#properties ("negate" property)
],
"allow-symlinks": false, // <true/false>
// Learn more about symlinks / symbolic-links:
// https://en.wikipedia.org/wiki/Symbolic_link
// https://github.com/paulmillr/chokidar#path-filtering ("followSymlinks")
"list-files": false, // <true/false>
// true: List the paths of the files being watched
// false: Print a "." (dot) character on the terminal screen for each file being watched
// This setting is applicable only during the initial launch of the "live-css" server. When a file matching the
// "watch-pattern" is newly created while the "live-css" server is already running, the path is listed anyways
"debug": false, // <true/false>
// true: Logs some extra information which is helpful in debugging
// false: Does not log the extra debugging related information
"version": "8.0.3" // This represents the version of the live-css server which was used for generating this configuration file
// This may be helpful while debugging some issues and informing users about new features
};