Add some additional docs for webpack 2 usage.
See original GitHub issueHello, you may add the following note for webpack 2 usage. Please add my github name as a contributor to the package if you decide to include this in your docs.
Note that ‘with’ that is deprecated in es6. For webpack 2 usage, you must pass an option in your query strict=true or _with=false that will disable with
in the ejs package.
Examples: strict=true
import tmpl1 from '!!../?strict=true!./template.ejs';
import tmpl2 from '!!../?delimiter=?&strict=true!./template2.ejs';
import tmpl3 from '!!../?strict=true!./subdir/parent.ejs';
_with=false
import tmpl1 from '!!../?_with=false!./template.ejs';
import tmpl2 from '!!../?delimiter=?&_with=false!./template2.ejs';
import tmpl3 from '!!../?_with=false!./subdir/parent.ejs';
Template examples:
You will need to refer to your vars from the locals object when with
has been disabled as illustrated below:
Hello, <%=locals.noun%>!
<? for(var key in locals.hobbies) { var hobby = locals.hobbies[key]; -?>
I like {{=hobby}}.
<? } ?>
child: <%= locals.foo %>
Issue Analytics
- State:
- Created 8 years ago
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Configuration - webpack
dev is an online tool for creating custom webpack configurations. It allows you to select various features that will be combined and added...
Read more >Entry Points - webpack
We will show you the ways you can configure the entry property, in addition to explaining why it may be useful to you....
Read more >webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >Getting Started - webpack
Custom parameters can be passed to webpack by adding two dashes between the npm run build command and your parameters, e.g. npm run...
Read more >Loaders - webpack
Loaders are transformations that are applied to the source code of a module. They allow you to pre-process files as you import or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
kinda rotten, reopen if needed.
@AndreiSoroka Do you know how to get webpack watch changes for include files?