Skip to content

Commit b451d8d

Browse files
author
Dennis Miasoutov
committed
Targeting ES2015 by default.
1 parent 8955d48 commit b451d8d

File tree

12 files changed

+18
-22
lines changed

12 files changed

+18
-22
lines changed

app/components/body.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ export class Body extends React.Component<BodyProps> {
1212
public render() {
1313
const { scripts, markup, bodyAttrs } = this.props;
1414

15+
const type = process.env.SCRIPTS_TYPE;
16+
1517
const renderScripts = scripts.map((scriptSrc, i) => (
16-
<script src={scriptSrc} key={i} charSet="utf-8" />
18+
<script type={type} src={scriptSrc} key={i} charSet="utf-8" />
1719
));
1820

1921
const renderInlineScripts = this.getInlineScripts().map((script, i) => (

app/flavors/basic/render.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export function render(callback: RenderCallback, props: RenderFuncProps): void {
1818
markup,
1919
};
2020

21-
const html = renderToStaticMarkup(<HelmetHtml {...htmlProps} />);
21+
const html =
22+
"<!DOCTYPE html>" + renderToStaticMarkup(<HelmetHtml {...htmlProps} />);
2223

2324
callback(undefined, {
2425
html,

app/flavors/router-redux-async/render.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ export function render(callback: RenderCallback, props: RenderFuncProps): void {
4545
markup,
4646
};
4747

48-
const html = renderToStaticMarkup(<HelmetHtml {...htmlProps} />);
48+
const html =
49+
"<!DOCTYPE html>" +
50+
renderToStaticMarkup(<HelmetHtml {...htmlProps} />);
4951

5052
callback(undefined, {
5153
html,

app/flavors/router-redux/render.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export function render(callback: RenderCallback, props: RenderFuncProps): void {
2121
markup,
2222
};
2323

24-
const html = renderToStaticMarkup(<HelmetHtml {...htmlProps} />);
24+
const html =
25+
"<!DOCTYPE html>" + renderToStaticMarkup(<HelmetHtml {...htmlProps} />);
2526

2627
callback(undefined, {
2728
html,

app/wtb.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"flavor": "basic",
55
"ssrModule": null,
66
"extend": null,
7-
"devApiUrl": "http://localhost:5000"
7+
"devApiUrl": "http://localhost:5000",
8+
"type": "module"
89
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webpack-typescript-builder",
3-
"version": "0.0.0",
3+
"version": "0.2.4",
44
"description": "Webpack config builder for typescript, styles (css and sass), fonts and images.",
55
"typings": "lib/config-builder/index.d.js",
66
"main": "lib/config-builder/index.js",

src/cli/commands/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export function createConfigs(dir: string): webpack.Configuration[] {
9595
NODE_ENV: JSON.stringify(
9696
program.production ? "production" : "development",
9797
),
98+
SCRIPTS_TYPE: JSON.stringify(settings.type),
9899
},
99100
});
100101

src/cli/settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export interface Settings {
55
ssrModule?: string;
66
extend?: ExtendConfigSettings;
77
devApiUrl: string;
8+
type: string;
89
}
910

1011
export interface ExtendConfigSettings {

src/config-builder/rules/javascript.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/config-builder/rules/typescript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import tsImportPluginFactory from "ts-import-plugin";
12
import * as webpack from "webpack";
2-
const tsImportPluginFactory = require("ts-import-plugin");
33

44
export const typescript: webpack.Rule = {
55
test: /\.(ts|tsx)?$/,

0 commit comments

Comments
 (0)