Open ghstahl opened 7 years ago
I can import a tag from a js file, but my tags that contain imports are having issues.
import './components/header.tag'; import './components/sidebar.tag'; import './components/loading-indicator.tag'; <app> </app>
get transpiled to
import './components/header.tag'; import './components/sidebar.tag'; import './components/loading-indicator.tag'; riot.tag2('app', '<loading-indicator></loading-indicator> <header></header> <div class="container"> <div class="row"> <div class="col-sm-3 col-md-2 sidebar"> <div class="list-group table-of-contents"> <sidebar></sidebar> </div> </div> <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main"> <div id="riot-app"></div> </div> </div> </div>', '', '', function(opts) { var self = this; self.on('before-mount', () => { console.log('before-mount'); }); self.on('mount', () => { console.log(riot.EVT.app.out.appMount); riot.control.on(riot.EVT.app.out.appMount,self.onAppMount); riot.control.trigger('riot-dispatch',riot.EVT.app.out.appMount); }); self.on('unmount', () => { console.log(riot.EVT.app.out.appUnmount) riot.control.trigger('riot-dispatch',riot.EVT.app.out.appUnmount); riot.control.off(riot.EVT.app.out.appMount,self.onAppMount); }); self.onAppMount = () =>{ console.log('app '+ riot.EVT.appMount) } });
exports.plugins = { riot: { extension: 'tag', pattern: /\.tag$/ }, babel: { presets: [ 'latest', 'stage-0'] }, uglify: { mangle: false, compress: { global_defs: { DEBUG: false } } } };
@ghstahl Thanks for the issue. Going to fix today.
I can import a tag from a js file, but my tags that contain imports are having issues.
get transpiled to