File tree Expand file tree Collapse file tree 10 files changed +95
-3
lines changed
cases/_preprocessor/eta-default-with-options Expand file tree Collapse file tree 10 files changed +95
-3
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## 4.22.0 (2025-11-27)
4+
5+ - fix: preprocessor options for the default preprocessor
6+
37## 4.22.0-alpha.0 (2025-07-31)
48
59- feat(experimental): add support for markdown in nunjucks preprocessor
Original file line number Diff line number Diff line change @@ -48,10 +48,10 @@ class PluginService {
4848 // add reference for the preprocessor option into the loader options
4949 if ( pluginOptions . preprocessor != null && loaderOptions . preprocessor == null ) {
5050 loaderOptions . preprocessor = pluginOptions . preprocessor ;
51+ }
5152
52- if ( pluginOptions . preprocessorOptions && ! loaderOptions . preprocessorOptions ) {
53- loaderOptions . preprocessorOptions = pluginOptions . preprocessorOptions ;
54- }
53+ if ( pluginOptions . preprocessorOptions && ! loaderOptions . preprocessorOptions ) {
54+ loaderOptions . preprocessorOptions = pluginOptions . preprocessorOptions ;
5555 }
5656
5757 context = {
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html >
3+ < head >
4+ < title > Home</ title >
5+ </ head >
6+ < body >
7+ <!-- path to partials directory -->
8+ < div > header</ div >
9+ < nav > Navigation</ nav >
10+ < h1 > Breaking Bad</ h1 >
11+ < ul class ="people ">
12+ < li > Walter White</ li >
13+ < li > Jesse Pinkman</ li >
14+ </ ul >
15+ < img src ="assets/img/apple.02a7c382.png " alt ="apple " />
16+ <!-- path to partials directory -->
17+ < div > footer</ div >
18+ </ body >
19+ </ html >
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html >
3+ < head >
4+ < title > < %= it.title %> </ title >
5+ </ head >
6+ < body >
7+ <!-- path to partials directory -->
8+ < %~ include('src/views/partials/header.html') %>
9+ < %~ include('src/views/pages/includes/nav.html') %>
10+ < h1 > < %= it.headline %> </ h1 >
11+ < ul class ="people ">
12+ < % for (let i = 0; i < it .people.length; i++) {% >
13+ < li > < %= it.people[i] %> </ li >
14+ < % } %>
15+ </ ul >
16+ < img src ="@images/apple.png " alt ="apple " />
17+ <!-- path to partials directory -->
18+ < %~ include('src/views/partials/footer.html') %>
19+ </ body >
20+ </ html >
Original file line number Diff line number Diff line change 1+ < nav > Navigation</ nav >
Original file line number Diff line number Diff line change 1+ < div > footer</ div >
Original file line number Diff line number Diff line change 1+ < div > header</ div >
Original file line number Diff line number Diff line change 1+ const path = require ( 'path' ) ;
2+ const HtmlBundlerPlugin = require ( '@test/html-bundler-webpack-plugin' ) ;
3+
4+ module . exports = {
5+ mode : 'production' ,
6+
7+ output : {
8+ path : path . join ( __dirname , 'dist/' ) ,
9+ } ,
10+
11+ resolve : {
12+ alias : {
13+ '@images' : path . join ( __dirname , '../../../fixtures/images' ) ,
14+ } ,
15+ } ,
16+
17+ plugins : [
18+ new HtmlBundlerPlugin ( {
19+ entry : {
20+ index : {
21+ import : './src/views/pages/home.html' ,
22+ data : {
23+ title : 'Home' ,
24+ headline : 'Breaking Bad' ,
25+ people : [ 'Walter White' , 'Jesse Pinkman' ] ,
26+ } ,
27+ } ,
28+ } ,
29+ // test default preprocessor (eta) and preprocessorOptions
30+ preprocessorOptions : { useWith : false } ,
31+ } ) ,
32+ ] ,
33+
34+ module : {
35+ rules : [
36+ {
37+ test : / \. ( p n g | s v g | j p e ? g | w e b p ) $ / i,
38+ type : 'asset/resource' ,
39+ generator : {
40+ filename : 'assets/img/[name].[hash:8][ext]' ,
41+ } ,
42+ } ,
43+ ] ,
44+ } ,
45+ } ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ beforeAll(() => {
88
99describe ( 'Eta' , ( ) => {
1010 test ( 'default' , ( ) => compareFiles ( '_preprocessor/eta-default' ) ) ;
11+ test ( 'default with options' , ( ) => compareFiles ( '_preprocessor/eta-default-with-options' ) ) ;
1112 test ( 'option views' , ( ) => compareFiles ( '_preprocessor/eta-option-views' ) ) ;
1213 test ( 'option async' , ( ) => compareFiles ( '_preprocessor/eta-option-async' ) ) ;
1314 test ( 'include md' , ( ) => compareFiles ( '_preprocessor/eta-include-md' ) ) ;
You can’t perform that action at this time.
0 commit comments