-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: emliminate output js when empty
- Loading branch information
1 parent
7b996ce
commit 00ac6e9
Showing
8 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...__/fixtures/basic-template-plugin-production/__snapshots__/webpack4/browser--test_7Fk-.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
..._tests__/fixtures/basic-template-plugin-production/__snapshots__/webpack4/server--main.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
..._tests__/fixtures/basic-template-plugin-production/__snapshots__/webpack5/server--main.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
src/__tests__/fixtures/basic-template-plugin-production/server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const http = require("http"); | ||
const test = require("./test.marko"); | ||
|
||
http | ||
.createServer((req, res) => { | ||
test.render({}, res); | ||
}) | ||
.listen(0); |
1 change: 1 addition & 0 deletions
1
src/__tests__/fixtures/basic-template-plugin-production/test.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>Hello World</h1> |
42 changes: 42 additions & 0 deletions
42
src/__tests__/fixtures/basic-template-plugin-production/webpack.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import * as path from "path"; | ||
import * as webpack from "webpack"; | ||
import MarkoPlugin from "../../../plugin"; | ||
|
||
const markoPlugin = new MarkoPlugin(); | ||
|
||
export default [ | ||
{ | ||
name: "server", | ||
target: "async-node", | ||
mode: "production", | ||
entry: path.join(__dirname, "server.js"), | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.marko$/, | ||
loader: "@marko/webpack/loader" | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
"process.env.BUNDLE": true | ||
}), | ||
markoPlugin.server | ||
] | ||
}, | ||
{ | ||
name: "browser", | ||
target: "web", | ||
mode: "production", | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.marko$/, | ||
loader: "@marko/webpack/loader" | ||
} | ||
] | ||
}, | ||
plugins: [markoPlugin.browser] | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters