remove transpile modules (#670)

* remove transpile modules

* remove dependency
This commit is contained in:
Steve Ruiz 2022-05-11 09:55:31 +01:00 committed by GitHub
parent 2b484cf93a
commit e78f9a086a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 55 additions and 67 deletions

View file

@ -1,7 +1,6 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const withPWA = require('next-pwa')
const SentryWebpackPlugin = require('@sentry/webpack-plugin')
const withTM = require('next-transpile-modules')(['@tldraw/tldraw', '@tldraw/core'])
const {
GITHUB_ID,
@ -21,59 +20,57 @@ const isProduction = NODE_ENV === 'production'
const basePath = ''
module.exports = withPWA(
withTM({
reactStrictMode: true,
pwa: {
disable: !isProduction,
dest: 'public',
},
productionBrowserSourceMaps: true,
env: {
NEXT_PUBLIC_COMMIT_SHA: VERCEL_GIT_COMMIT_SHA,
GA_MEASUREMENT_ID,
GITHUB_ID,
GITHUB_API_SECRET,
},
webpack: (config, options) => {
if (!options.isServer) {
config.resolve.alias['@sentry/node'] = '@sentry/browser'
}
module.exports = withPWA({
reactStrictMode: true,
pwa: {
disable: !isProduction,
dest: 'public',
},
productionBrowserSourceMaps: true,
env: {
NEXT_PUBLIC_COMMIT_SHA: VERCEL_GIT_COMMIT_SHA,
GA_MEASUREMENT_ID,
GITHUB_ID,
GITHUB_API_SECRET,
},
webpack: (config, options) => {
if (!options.isServer) {
config.resolve.alias['@sentry/node'] = '@sentry/browser'
}
config.plugins.push(
new options.webpack.DefinePlugin({
'process.env.NEXT_IS_SERVER': JSON.stringify(options.isServer.toString()),
})
)
config.module.rules.push({
test: /.*packages.*\.js$/,
use: ['source-map-loader'],
enforce: 'pre',
})
if (
SENTRY_DSN &&
SENTRY_ORG &&
SENTRY_PROJECT &&
SENTRY_AUTH_TOKEN &&
VERCEL_GIT_COMMIT_SHA &&
isProduction
) {
config.plugins.push(
new options.webpack.DefinePlugin({
'process.env.NEXT_IS_SERVER': JSON.stringify(options.isServer.toString()),
new SentryWebpackPlugin({
include: '.next',
ignore: ['node_modules'],
stripPrefix: ['webpack://_N_E/'],
urlPrefix: `~${basePath}/_next`,
release: VERCEL_GIT_COMMIT_SHA,
authToken: SENTRY_AUTH_TOKEN,
org: SENTRY_PROJECT,
project: SENTRY_ORG,
})
)
config.module.rules.push({
test: /.*packages.*\.js$/,
use: ['source-map-loader'],
enforce: 'pre',
})
if (
SENTRY_DSN &&
SENTRY_ORG &&
SENTRY_PROJECT &&
SENTRY_AUTH_TOKEN &&
VERCEL_GIT_COMMIT_SHA &&
isProduction
) {
config.plugins.push(
new SentryWebpackPlugin({
include: '.next',
ignore: ['node_modules'],
stripPrefix: ['webpack://_N_E/'],
urlPrefix: `~${basePath}/_next`,
release: VERCEL_GIT_COMMIT_SHA,
authToken: SENTRY_AUTH_TOKEN,
org: SENTRY_PROJECT,
project: SENTRY_ORG,
})
)
}
return config
},
})
)
}
return config
},
})

View file

@ -29,20 +29,19 @@
"@tldraw/tldraw": "^1.11.1",
"@types/next-auth": "^3.15.0",
"aws-sdk": "^2.1053.0",
"chrome-aws-lambda": "8.0.2",
"next": "^12.0.7",
"next-auth": "^4.0.5",
"next-pwa": "^5.4.4",
"next-themes": "^0.0.15",
"next-transpile-modules": "^9.0.0",
"chrome-aws-lambda": "8.0.2",
"puppeteer-core": "9.0.0",
"react": "17.0.2",
"react-dom": "17.0.2"
},
"devDependencies": {
"@sentry/webpack-plugin": "^1.17.1",
"@tldraw/core": "*",
"@tldraw/tldraw": "*",
"@sentry/webpack-plugin": "^1.17.1",
"@types/react": "^17.0.19",
"@types/react-dom": "^17.0.9",
"cors": "^2.8.5",
@ -51,4 +50,4 @@
"typescript": "^4.5.2"
},
"gitHead": "838fabdbff1a66d4d7ee8aa5c5d117bc55acbff2"
}
}

View file

@ -215,7 +215,7 @@ export function Tldraw({
// Toggle the app's darkMode when the `darkMode` prop changes.
React.useEffect(() => {
if (darkMode !== app.settings.isDarkMode){
if (darkMode !== app.settings.isDarkMode) {
app.toggleDarkMode()
}
}, [app, darkMode])

View file

@ -5443,7 +5443,7 @@ enhanced-resolve@^5.0.0:
graceful-fs "^4.2.4"
tapable "^2.2.0"
enhanced-resolve@^5.7.0, enhanced-resolve@^5.8.3:
enhanced-resolve@^5.8.3:
version "5.9.0"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.9.0.tgz#49ac24953ac8452ed8fed2ef1340fc8e043667ee"
integrity sha512-weDYmzbBygL7HzGGS26M3hGQx68vehdEg6VUmqSOaFzXExFqlnKuSvsEJCVGQHScS8CQMbrAqftT+AzzHNt/YA==
@ -8932,14 +8932,6 @@ next-themes@^0.0.15:
resolved "https://registry.yarnpkg.com/next-themes/-/next-themes-0.0.15.tgz#ab0cee69cd763b77d41211f631e108beab39bf7d"
integrity sha512-LTmtqYi03c4gMTJmWwVK9XkHL7h0/+XrtR970Ujvtu3s0kZNeJN24aJsi4rkZOI8i19+qq6f8j+8Duwy5jqcrQ==
next-transpile-modules@^9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/next-transpile-modules/-/next-transpile-modules-9.0.0.tgz#133b1742af082e61cc76b02a0f12ffd40ce2bf90"
integrity sha512-VCNFOazIAnXn1hvgYYSTYMnoWgKgwlYh4lm1pKbSfiB3kj5ZYLcKVhfh3jkPOg1cnd9DP+pte9yCUocdPEUBTQ==
dependencies:
enhanced-resolve "^5.7.0"
escalade "^3.1.1"
next@^12.0.7:
version "12.1.0"
resolved "https://registry.yarnpkg.com/next/-/next-12.1.0.tgz#c33d753b644be92fc58e06e5a214f143da61dd5d"