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
> Experimental support for decorators is a feature that is subject to change in a future release.<br/>
153
+
> Set the 'experimentalDecorators' option to remove this warning.
154
+
155
+
`typescript-closure-compiler` changes this behaviour and omits all decorators relevant code when the `experimentalDecorators` is not enabled, thus ensuring that the generated javascript will not include unnecessary code.<br/>
156
+
In addition `typescript-closure-compiler` enables you to use the `ignoreDecoratorsWarning` option in order to ignore the warning message.<br/>
157
+
These two options enables you to write your code once using decorations, but to omit the decorations related code using configuration, much like choosing the verbosity of a logger using configuration.<br/><br/>
158
+
A reasonable scenario would be to decorate your class/methods/params with decorators for debug purposes but to omit this code in the final release.<br/>
159
+
All you have to do is create two tsconfig.json files one for debug and one for release.<br/>
160
+
The release file should include the `ignoreDecoratorsWarning`.
161
+
The debug file should include the `experimentalDecorators`.
162
+
163
+
#### release
164
+
```js
165
+
{
166
+
"compilerOptions": {
167
+
"ignoreDecoratorsWarning":true
168
+
}
169
+
"files": [
170
+
]
171
+
}
172
+
```
173
+
#### debug
174
+
```js
175
+
{
176
+
"compilerOptions": {
177
+
"experimentalDecorators":true
178
+
}
179
+
"files": [
180
+
]
181
+
}
182
+
```
133
183
134
184
### Usage Examples
135
185
@@ -170,4 +220,4 @@ jake build
170
220
171
221
## License
172
222
173
-
Like the TypeScript compiler itself, this code is licensed under the [Apache License 2.0](http://typescript.codeplex.com/license).
223
+
Like the TypeScript compiler itself, this code is licensed under the [Apache License 2.0](http://typescript.codeplex.com/license).
0 commit comments