FEATURE: Plugin support for transpiling regular .js files (#9398)

This adds support for a new piece of metadata to your plugin.rb
files. If you add:

```
transpile_js: true
```

Then Discourse will support transpilation of assets in your
`assets/javascripts` directory. Previously they had to be named
`.js.es6` but now regular `.js` will work.

Note this is opt-in because some plugins currently have `.js` files in
app/assets that are not meant to be transpiled.

Going forward all plugins should migrate to this setting as they are
comfortable able to do so.
This commit is contained in:
Robin Ward
2020-04-13 15:05:46 -04:00
committed by GitHub
parent 799ddeea3c
commit 7b4fdebbce
3 changed files with 26 additions and 4 deletions

View File

@@ -78,7 +78,7 @@ class Plugin::Metadata
"discourse-internet-explorer"
])
FIELDS ||= [:name, :about, :version, :authors, :url, :required_version]
FIELDS ||= [:name, :about, :version, :authors, :url, :required_version, :transpile_js]
attr_accessor(*FIELDS)
def self.parse(text)