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

ENG-3402 Named classes for styled-components #721

Merged
merged 4 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,11 @@
"tsc-files": "^1.1.4",
"tsconfig-paths-webpack-plugin": "^4.0.0",
"type-fest": "^2.19.0",
"typescript": "^4.8.2",
"typescript": "^5.0.0",
"vitest": "^0.34.6",
"webpack": "^5.89.0",
"webpack-cli": "^4.0.0",
"webpack-dev-server": "^4.11.0"
"webpack-dev-server": "^4.11.0",
"typescript-plugin-styled-components": "^3.0.0"
}
}
33 changes: 22 additions & 11 deletions webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const ReactRefreshTypeScript = require('react-refresh-typescript');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const Dotenv = require('dotenv-webpack');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const createStyledComponentsTransformer = require('typescript-plugin-styled-components').default;
const styledComponentsTransformer = createStyledComponentsTransformer();

const aliases = {
// alias stacks.js packages to their esm (default prefers /dist/polyfill)
Expand Down Expand Up @@ -68,9 +70,14 @@ var options = {
loader: 'ts-loader',
options: {
getCustomTransformers: () => ({
before: [env.NODE_ENV === 'development' && ReactRefreshTypeScript()].filter(
Boolean
),
// before: [
// env.NODE_ENV === 'development' && ReactRefreshTypeScript(),
// env.NODE_ENV === 'development' && styledComponentsTransformer,
// ].filter(Boolean),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can remove these commented out lines

jordankzf marked this conversation as resolved.
Show resolved Hide resolved
before:
env.NODE_ENV === 'development'
? [ReactRefreshTypeScript(), styledComponentsTransformer]
: [],
}),
transpileOnly: false,
},
Expand All @@ -91,9 +98,11 @@ var options = {
],
},
resolve: {
plugins: [new TsconfigPathsPlugin({
configFile: path.join(__dirname, '../', 'tsconfig.json')
})],
plugins: [
new TsconfigPathsPlugin({
configFile: path.join(__dirname, '../', 'tsconfig.json'),
}),
],
extensions: fileExtensions
.map((extension) => '.' + extension)
.concat(['.js', '.jsx', '.ts', '.tsx', '.css']),
Expand Down Expand Up @@ -124,7 +133,7 @@ var options = {
description: process.env.npm_package_description,
version: process.env.npm_package_version,
...JSON.parse(content.toString()),
})
}),
);
},
},
Expand All @@ -139,9 +148,11 @@ var options = {
],
}),
new CopyWebpackPlugin({
patterns: [{
from: 'node_modules/webextension-polyfill/dist/browser-polyfill.js',
}],
patterns: [
{
from: 'node_modules/webextension-polyfill/dist/browser-polyfill.js',
},
],
}),
new HtmlWebpackPlugin({
template: path.join(SRC_ROOT_PATH, 'pages', 'Options', 'index.html'),
Expand All @@ -160,7 +171,7 @@ var options = {
Buffer: ['buffer', 'Buffer'],
}),
new webpack.DefinePlugin({
VERSION: JSON.stringify(require("../package.json").version),
VERSION: JSON.stringify(require('../package.json').version),
}),
],

Expand Down
Loading