mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 02:16:10 +08:00

`.js.no-module.es6` files will be transpiled without producing a module. import/export statements are deliberately not supported, so one would still need to use `const module = require('moduleName').default.`
5 lines
267 B
Ruby
5 lines
267 B
Ruby
require 'sprockets'
|
|
|
|
Sprockets.register_mime_type 'application/ecmascript6', extensions: ['.es6', '.js.es6', '.js.no-module.es6'], charset: :unicode
|
|
Sprockets.register_transformer 'application/ecmascript6', 'application/javascript', Tilt::ES6ModuleTranspilerTemplate
|