mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
* chore[next-pwa]: resolve `workbox-build` types package versions mismatch * chore[next-pwa]: add tests to check type `WebpackConfigOptions` * chore[next-pwa]: remove `@types/workbox-build` in favour of package types bundle * fix[next-pwa]: bump minimum Typescript version from `4.6` to `4.9` * chore[next-pwa]: revert minimin ts version to `4.5` * fix[next-pwa]: remove stale `workbox-_` DT packages * deps: remove multiple `workbox-_` DT packages * deps: remove even MORE `workbox-_` DT packages * Revert "fix[next-pwa]: remove stale `workbox-_` DT packages" This reverts commit eb0d61a97b08d2d26cf73dea48824877cc077cde. * Revert "deps: remove multiple `workbox-_` DT packages" This reverts commit 9bcdc74673e3652e54686e335e9da87820849b40. * Revert "deps: remove even MORE `workbox-_` DT packages" This reverts commit 196038096a43a6e4e1b9a69cedc7d21091c85690. * revert: remove `workbox-sw` from not-needed packages file * fix[customize-cra]: add module interop flag; add lib * deps[workbox-sw]: add workbox packages to `packages.json` * chore[workbox-sw]: add tests * chore: use `@types/` deps to refer to old DT packages types * chore: remove `esModuleInterop` flag * chore[customize-cra]: remove `webworker` lib * fix: correct import statements
119 lines
3.2 KiB
TypeScript
119 lines
3.2 KiB
TypeScript
import {
|
|
override,
|
|
overrideDevServer,
|
|
addDecoratorsLegacy,
|
|
disableEsLint,
|
|
addBundleVisualizer,
|
|
addWebpackAlias,
|
|
addBabelPresets,
|
|
adjustWorkbox,
|
|
watchAll,
|
|
addBabelPlugins,
|
|
addExternalBabelPlugins,
|
|
babelExclude,
|
|
babelInclude,
|
|
fixBabelImports,
|
|
removeInternalBabelPlugin,
|
|
useBabelRc,
|
|
addLessLoader,
|
|
addPostcssPlugins,
|
|
addWebpackModuleRule,
|
|
setWebpackStats,
|
|
setWebpackTarget,
|
|
tap,
|
|
adjustStyleLoaders,
|
|
} from 'customize-cra';
|
|
import * as path from 'path';
|
|
|
|
module.exports = override(
|
|
addDecoratorsLegacy(),
|
|
|
|
disableEsLint(),
|
|
|
|
addBundleVisualizer(),
|
|
|
|
addWebpackAlias({
|
|
['ag-grid-react$']: path.resolve(__dirname, 'src/shared/agGridWrapper.js'),
|
|
}),
|
|
|
|
adjustWorkbox(workbox => ({
|
|
...workbox,
|
|
skipWaiting: true,
|
|
exclude: (workbox.exclude || []).concat('index.html'),
|
|
})),
|
|
);
|
|
|
|
module.exports = {
|
|
webpack: override(
|
|
// usual webpack plugin
|
|
disableEsLint(),
|
|
),
|
|
devServer: overrideDevServer(
|
|
// dev server plugin
|
|
watchAll(),
|
|
),
|
|
};
|
|
|
|
module.exports = override(
|
|
disableEsLint(),
|
|
...addExternalBabelPlugins('babel-plugin-transform-do-expressions', '@babel/plugin-proposal-object-rest-spread'),
|
|
fixBabelImports('lodash', {
|
|
libraryDirectory: '',
|
|
camel2DashComponentName: false,
|
|
}),
|
|
fixBabelImports('react-feather', {
|
|
libraryName: 'react-feather',
|
|
libraryDirectory: 'dist/icons',
|
|
}),
|
|
...addBabelPlugins('polished', 'emotion', 'babel-plugin-transform-do-expressions'),
|
|
...addBabelPresets(
|
|
[
|
|
'@babel/env',
|
|
{
|
|
targets: {
|
|
browsers: ['> 1%', 'last 2 versions'],
|
|
},
|
|
modules: 'commonjs',
|
|
},
|
|
],
|
|
'@babel/preset-flow',
|
|
'@babel/preset-react',
|
|
),
|
|
babelInclude([
|
|
path.resolve('src'), // make sure you link your own source
|
|
path.resolve('node_modules/native-base-shoutem-theme'),
|
|
path.resolve('node_modules/react-navigation'),
|
|
path.resolve('node_modules/react-native-easy-grid'),
|
|
]),
|
|
babelExclude([path.resolve('src/excluded-folder')]),
|
|
removeInternalBabelPlugin('plugin-name'),
|
|
addWebpackModuleRule({ test: /\.txt$/, use: 'raw-loader' }),
|
|
setWebpackTarget('electron-renderer'),
|
|
setWebpackStats('errors-only'),
|
|
addBundleVisualizer({}, true),
|
|
useBabelRc(),
|
|
addLessLoader({
|
|
strictMath: true,
|
|
noIeCompat: true,
|
|
modifyVars: {
|
|
'@primary-color': '#1DA57A', // for example, you use Ant Design to change theme color.
|
|
},
|
|
cssLoaderOptions: {}, // .less file used css-loader option, not all CSS file.
|
|
cssModules: {
|
|
localIdentName: '[path][name]__[local]--[hash:base64:5]', // if you use CSS Modules, and custom `localIdentName`, default is '[local]--[hash:base64:5]'.
|
|
},
|
|
}),
|
|
addPostcssPlugins([]),
|
|
adjustStyleLoaders(({ use }) => {
|
|
if (!Array.isArray(use)) return;
|
|
const [, css, postcss, resolve, processor] = use;
|
|
|
|
if (typeof css !== 'object') return;
|
|
|
|
console.log(css.options);
|
|
}),
|
|
|
|
tap({ message: 'Pre - Customizers' }),
|
|
tap({ dest: 'customize-cra.log' }),
|
|
);
|