mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 15:05:24 +08:00
8b2a379e4e
`.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
|