Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with typescript #1

Closed
rbabayoff opened this issue Jun 29, 2022 · 1 comment
Closed

Doesn't work with typescript #1

rbabayoff opened this issue Jun 29, 2022 · 1 comment

Comments

@rbabayoff
Copy link

Hey Kevin,

If you prefer to reopen the community topic so I can post there, let me know.

Your sentry example does work and does report errors but the source maps don't work with typescript. I tried to change tsconfig.json to both sourceMaps and inlineSourceMaps and neither work.

See here for what's going on in sentry.

Here's bundler.js:

const createBundler = require("@airtable/blocks-webpack-bundler").default;
const SentryPlugin = require("@sentry/webpack-plugin");
const SentryConfig = require("./sentryConfig");

function createConfig(baseConfig) {
	baseConfig.module.rules.push({
		test: /\.tsx?$/,
		exclude: [/node_modules/],
		loader: "babel-loader",
		options: {
			babelrc: false,
			configFile: false,
			presets: [
				require.resolve("@babel/preset-env"),
				require.resolve("@babel/preset-react"),
				require.resolve("@babel/preset-typescript"),
			],
			plugins: [
				["@babel/plugin-proposal-decorators", { legacy: true }],
				["@babel/plugin-proposal-class-properties", { loose: false }],
				// In contrast to MobX 4/5, "loose" must be false!    ^
			],
		},
	});

	if (baseConfig.mode === "production") {
		baseConfig.devtool = "source-map";
		baseConfig.plugins = (baseConfig.plugins || []).concat([
			new SentryPlugin({
				release: SentryConfig.RELEASE_VERSION,
				include: "./.tmp/dist",
			}),
		]);
	}

	return baseConfig;
}

exports.default = () => {
	return createBundler(createConfig);
};

Thanks,
Ronen

@kevinwilde-at
Copy link
Owner

Closing in favor of #2

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

No branches or pull requests

2 participants