baggage-loader
baggage-loader copied to clipboard
Not working with Typescript?
Maybe I'm doing something wrong but I can't seem to make this work with Typescript. I've configured everything as per various examples:
preLoaders: [
{
test : /\.ts$/,
loader: 'baggage?[file].html&[file].css'
}
],
loaders : [
{
test : /\.ts$/,
loaders: [
'awesome-typescript-loader?module=common'
],
}
],
My file structure seems correct:
- SongsTable.ts
- SongsTable.html
If I go into baggage's code and log baggageFile
and stats.isFile()
everything is correct – the file path is correct, it exists, the inject
variable even holds the correct output. But in my final bundle the baggage inject is nowhere to be found. Am I doing something wrong or?
do you have any example repo so I can try to reproduce it myself?
It works for me with TypeScript (similar configuration to above - baggage is set as a preLoader).
P.S. It's useful to f.e. set in your definitions file like global.d.ts
a global var, by f.e. declare var template: string;
. This will avoid showing errors in f.e. your component files that the template
variable is missing.
https://github.com/deepsweet/baggage-loader/issues/11