Skip to content

1.1.2 outputs .json file instead of .js file #47

@turnerhayes

Description

@turnerhayes

It appears that something between 1.1.0 and 1.1.2 has changed the output from a .js file to a .json file. This is what appears in the htmlWebpackPlugin variable in each version:

1.1.0:

{
"files": {
	"publicPath": "/static/",
	"chunks": {
		"webpackManifest": {
			"size": 0,
			"entry": "/static/js/webpackManifest-d41d8cd98f00b204e980.js",
			"hash": "d41d8cd98f00b204e980",
			"css": []
		},
		"vendor": {
			"size": 2626754,
			"entry": "/static/js/vendor-392d99b5276c8459890d.js",
			"hash": "392d99b5276c8459890d",
			"css": [
				"/static/css/vendor-92e4a31a26173772f8ef.css"
			]
		},
		"main": {
			"size": 147201,
			"entry": "/static/js/main-819a8466ef5c6c51cd36.js",
			"hash": "819a8466ef5c6c51cd36",
			"css": [
				"/static/css/main-92e4a31a26173772f8ef.css"
			]
		}
	},
	"js": [
		"/static/js/webpackManifest-d41d8cd98f00b204e980.js",
		"/static/js/vendor-392d99b5276c8459890d.js",
		"/static/js/main-819a8466ef5c6c51cd36.js"
	],
	"css": [
		"/static/css/vendor-92e4a31a26173772f8ef.css",
		"/static/css/main-92e4a31a26173772f8ef.css"
	],
	"webpackManifest": ""
},
"options": {
	"template": "/projects/websites/quintro/node_modules/html-webpack-plugin/lib/loader.js!/projects/websites/quintro/server/views/index.template.ejs",
	"filename": "../server/views/index.hbs",
	"hash": false,
	"inject": false,
	"compile": true,
	"favicon": false,
	"minify": {
		"collapseBooleanAttributes": true,
		"collapseWhitespace": true
	},
	"cache": true,
	"showErrors": true,
	"chunks": "all",
	"excludeChunks": [],
	"title": "Quintro",
	"xhtml": false,
	"alwaysWriteToDisk": true,
	"staticContentURL": "https://localhost:7200"
}
}

1.1.2:

{
"files": {
	"publicPath": "/static/",
	"chunks": {
		"webpackManifest": {
			"size": 0,
			"entry": "/static/webpackManifest.json",
			"hash": "d41d8cd98f00b204e980",
			"css": []
		},
		"vendor": {
			"size": 2626754,
			"entry": "/static/js/vendor-392d99b5276c8459890d.js",
			"hash": "392d99b5276c8459890d",
			"css": [
				"/static/css/vendor-6946c2dfdd053e5b7448.css"
			]
		},
		"main": {
			"size": 147201,
			"entry": "/static/js/main-819a8466ef5c6c51cd36.js",
			"hash": "819a8466ef5c6c51cd36",
			"css": [
				"/static/css/main-6946c2dfdd053e5b7448.css"
			]
		}
	},
	"js": [
		"/static/webpackManifest.json",
		"/static/js/vendor-392d99b5276c8459890d.js",
		"/static/js/main-819a8466ef5c6c51cd36.js"
	],
	"css": [
		"/static/css/vendor-6946c2dfdd053e5b7448.css",
		"/static/css/main-6946c2dfdd053e5b7448.css"
	],
	"webpackManifest": ""
},
"options": {
	"template": "/projects/websites/quintro/node_modules/html-webpack-plugin/lib/loader.js!/projects/websites/quintro/server/views/index.template.ejs",
	"filename": "../server/views/index.hbs",
	"hash": false,
	"inject": false,
	"compile": true,
	"favicon": false,
	"minify": {
		"collapseBooleanAttributes": true,
		"collapseWhitespace": true
	},
	"cache": true,
	"showErrors": true,
	"chunks": "all",
	"excludeChunks": [],
	"title": "Quintro",
	"xhtml": false,
	"alwaysWriteToDisk": true,
	"staticContentURL": "https://localhost:7200"
}
}

Since I have a custom template for HTMLWebpackPlugin that iterates over the js files, this throws an error because it's trying to load a JSON file as a <script src> rather than a .js file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions