-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webpack uglify cannot recognize "`" #229
Comments
template literals seem to work normally, can you provide a failing example? This works for me in the playground: template: <div rt-scope="42 as a; 1 as b">{`hello ${a+b}`}</div> output:
I guess there must be something wrong in your build/transpile pipeline, make sure that the output from RT (which is ES6) is transpiled into ES5 by some way (babel, typescript etc). |
Hello thank you for the reply. Everything is fine up until the uglify plugin when running the a webpack production build. This is the code missing some elements for brevity:
I can see in the final build that template literals are not transpiled And my webpack 3 build is the following, for .rt and babel: {
test: /\.rt$/,
use: {
loader: 'react-templates-loader?modules=es6',
},
},
{
test: /\.js$/,
exclude: /(node_modules)/,
use: [
{
loader: 'babel-loader',
options: {
presets: [
'es2015',
'stage-0',
'react',
],
plugins: [
'transform-decorators-legacy',
'transform-decorators',
'lodash'
],
},
},
],
}, |
with this config the output of The reason why you are not seeing any error is that during development you are using an ES6 browser and you are also skipping Solution: chain
I've not tested it, but it should work. |
...It did.... You sir helped me greatly. What can I say... I am still learning :-) Thank you for all the help. |
Hello,
It seems that template literals when used inside .rt files are not being transpiled afterwards properly, hence the error from uglify for webpack. Is there a workaround apart from creating a state based variable? Thank you for all the help.
The text was updated successfully, but these errors were encountered: