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

Switch back to ts-loader #3545

Merged
merged 1 commit into from
Jan 7, 2019
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ All notable, unreleased changes to this project will be documented in this file.
- Fixed hard-coded site name in order PDFs - #3526 by @NyanKiyoshi
- Extract enums to separate files - #3523 by @maarcingebala
- Add default variant create to Product mutations - #3505 by @fowczarek
- Change TypeScript loader to speed up the build process - #3545 by @patrys
2,392 changes: 1,330 additions & 1,062 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
"@types/react-router-dom": "^4.2.6",
"@types/react-test-renderer": "^16.0.3",
"autoprefixer": "^8.2.0",
"awesome-typescript-loader": "^5.2.1",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^23.6.0",
Expand All @@ -119,6 +118,7 @@
"eslint-plugin-react": "^7.7.0",
"eslint-plugin-standard": "^3.0.1",
"file-loader": "^1.1.11",
"fork-ts-checker-webpack-plugin": "^0.5.2",
"jest": "^23.6.0",
"jest-file": "^1.0.0",
"mini-css-extract-plugin": "^0.4.0",
Expand All @@ -130,6 +130,7 @@
"regenerator-runtime": "^0.11.1",
"sass-loader": "^7.1.0",
"ts-jest": "^23.1.4",
"ts-loader": "^5.3.2",
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.15.0",
"webpack": "^4.27.0",
Expand Down

This file was deleted.

This file was deleted.

40 changes: 0 additions & 40 deletions saleor/static/dashboard-next/components/TabSwitch/TabSwitch.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions saleor/static/dashboard-next/components/TabSwitch/index.ts

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6080,6 +6080,8 @@ exports[`Storyshots Product types / Edit attribute form errors 1`] = `<div />`;

exports[`Storyshots Product types / Edit attribute loading 1`] = `<div />`;

exports[`Storyshots Products / ProductVariantImageSelectDialog default 1`] = `null`;

exports[`Storyshots SiteSettings / Add key dialog default 1`] = `<div />`;

exports[`Storyshots SiteSettings / Add key dialog form errors 1`] = `<div />`;
Expand Down
1 change: 1 addition & 0 deletions saleor/static/dashboard-next/storybook/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ function loadStories() {
require("./stories/products/ProductListCard");
require("./stories/products/ProductUpdatePage");
require("./stories/products/ProductVariantCreatePage");
require("./stories/products/ProductVariantImageSelectDialog");
require("./stories/products/ProductVariantPage");

// Orders
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ storiesOf("Products / ProductVariantImageSelectDialog", module).add(
() => (
<ProductVariantImageSelectDialog
images={variantProductImages}
selectedImages={variantImages}
selectedImages={variantImages.map(image => image.id)}
onClose={() => undefined}
onImageSelect={() => undefined}
open={true}
/>
)
Expand Down
13 changes: 7 additions & 6 deletions saleor/static/dashboard-next/storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/* eslint-disable */
const { CheckerPlugin } = require("awesome-typescript-loader")
const CheckerPlugin = require('fork-ts-checker-webpack-plugin');

module.exports = (baseConfig, env, config) => {
config.module.rules.push({
test: /\.tsx?$/,
exclude: /node_modules/,
loader: "awesome-typescript-loader",
loader: "ts-loader",
options: {
reportFiles: [
"saleor/**/*.{ts,tsx}"
],
useCache: true
experimentalWatchApi: true,
transpileOnly: true
}
});
config.optimization.removeAvailableModules = false;
config.optimization.removeEmptyChunks = false;
config.optimization.splitChunks = false;
config.resolve.extensions.push(".ts", ".tsx");
config.plugins.push(new CheckerPlugin());
return config;
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
"target": "es5",
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": ["webpack.d.ts"]
}
}
20 changes: 13 additions & 7 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const autoprefixer = require('autoprefixer');
const { CheckerPlugin } = require('awesome-typescript-loader');
const CheckerPlugin = require('fork-ts-checker-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
const url = require('url');
Expand All @@ -20,7 +20,10 @@ const providePlugin = new webpack.ProvidePlugin({
'query-string': 'query-string'
});

const checkerPlugin = new CheckerPlugin();
const checkerPlugin = new CheckerPlugin({
reportFiles: ['saleor/**/*.{ts,tsx}'],
tslint: true
});

module.exports = (env, argv) => {
const devMode = argv.mode !== 'production';
Expand Down Expand Up @@ -102,12 +105,10 @@ module.exports = (env, argv) => {
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'awesome-typescript-loader',
loader: 'ts-loader',
options: {
reportFiles: [
'saleor/**/*.{ts,tsx}'
],
useCache: true
experimentalWatchApi: true,
transpileOnly: true
}
},
{
Expand All @@ -122,6 +123,11 @@ module.exports = (env, argv) => {
}
]
},
optimization: {
removeAvailableModules: false,
removeEmptyChunks: false,
splitChunks: false
},
plugins: [
bundleTrackerPlugin,
extractCssPlugin,
Expand Down