Skip to content
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.

TS1056: Accessors are only available when targeting ECMAScript 5 and higher. #640

Open
guoliang opened this issue Aug 13, 2019 · 0 comments

Comments

@guoliang
Copy link

I'm running webpack with awesome-typescript-loader, and I get the error saying that Accessors are only available with es5. The thing is that in my tsconfig.json it already says target is es5. But somehow the loader doesn't pick it up.

My webpack config looks as following

const path = require("path");

module.exports = {
	entry: "./src/appbuilder/designer/app.ts",
	output: {
		path: path.resolve(__dirname, "dist"),
		filename: "appbuilder.js"
	},
	resolve: {
		extensions: [".ts", ".tsx", ".js", ".jsx"],
	},
	module: {
		rules: [
			{
				test: /\.tsx?$/,
				loader: "awesome-typescript-loader",
				options: {
					configFileName: path.resolve(__dirname, "appbuilder/tsconfig.json")
				}
			}
		]
	},
};


And my tsconfig.json looks like following

{
	"compileOnSave": true,
	"compilerOptions": {
		"declaration": true,
		"noImplicitAny": true,
		"noImplicitReturns": true,
		"preserveConstEnums": true,
		"sourceMap": true,
		"target": "es5"
	}
}

Is there some obvious errors in my configurations?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant