mirror of
https://github.com/discourse/discourse.git
synced 2025-02-18 17:42:46 +08:00
![David Taylor](/assets/img/avatar_default.png)
decorator-transforms (https://github.com/ef4/decorator-transforms) is a modern replacement for babel's plugin-proposal-decorators. It provides a decorator implementation using modern browser features, without needing to enable babel's full suite of class feature transformations. This improves the developer experience and performance. In local testing with Google's 'tachometer' tool, this reduces Discourse's 'init-to-render' time by around 3-4% (230ms -> 222ms). It reduces our initial gzip'd JS payloads by 3.2% (2.43MB -> 2.35MB), or 7.5% (14.5MB -> 13.4MB) uncompressed.
32 lines
488 B
JavaScript
32 lines
488 B
JavaScript
"use strict";
|
|
|
|
module.exports = {
|
|
name: require("./package").name,
|
|
options: {
|
|
autoImport: {
|
|
alias: {
|
|
handlebars: "handlebars/dist/cjs/handlebars.js",
|
|
},
|
|
},
|
|
|
|
babel: {
|
|
plugins: [
|
|
[
|
|
require.resolve("decorator-transforms"),
|
|
{
|
|
runEarly: true,
|
|
},
|
|
],
|
|
],
|
|
},
|
|
|
|
"ember-cli-babel": {
|
|
disableDecoratorTransforms: true,
|
|
},
|
|
},
|
|
|
|
isDevelopingAddon() {
|
|
return true;
|
|
},
|
|
};
|