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

Vue: Add support for tsx #11936

Merged
merged 2 commits into from Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions addons/docs/src/frameworks/react/jsxDecorator.tsx
Expand Up @@ -118,11 +118,11 @@ export const renderJsx = (code: React.ReactElement, options: JSXOptions) => {

if (string.indexOf('"') > -1) {
const matches = string.match(/\S+=\\"([^"]*)\\"/g);
if (matches) {
matches.forEach((match) => {
string = string.replace(match, match.replace(/"/g, "'"));
});
}
if (matches) {
matches.forEach((match) => {
string = string.replace(match, match.replace(/"/g, "'"));
});
}
}

return string;
Expand Down
14 changes: 13 additions & 1 deletion app/vue/src/server/framework-preset-vue.ts
Expand Up @@ -14,7 +14,7 @@ export async function webpack(config: Configuration, { presets }: Options) {
options: {},
});
config.module.rules.push({
test: /\.tsx?$/,
test: /\.ts$/,
use: [
{
loader: require.resolve('ts-loader'),
Expand All @@ -25,6 +25,18 @@ export async function webpack(config: Configuration, { presets }: Options) {
},
],
});
config.module.rules.push({
test: /\.tsx$/,
use: [
{
loader: require.resolve('ts-loader'),
options: {
transpileOnly: true,
appendTsxSuffixTo: [/\.vue$/],
},
},
],
});

config.resolve.extensions.push('.vue');
config.resolve.alias = { ...config.resolve.alias, vue$: require.resolve('vue/dist/vue.esm.js') };
Expand Down
2 changes: 1 addition & 1 deletion lib/components/src/blocks/ColorPalette.tsx
Expand Up @@ -81,7 +81,7 @@ const SwatchColors = styled.div(({ theme }) => ({
overflow: 'hidden',
backgroundColor: 'white',
backgroundImage: `repeating-linear-gradient(-45deg, #ccc, #ccc 1px, #fff 1px, #fff 16px)`,
backgroundClip: 'padding-box'
backgroundClip: 'padding-box',
}));

const SwatchSpecimen = styled.div({
Expand Down