Skip to content

Commit

Permalink
Merge pull request #401 from atls/fix/code-servie
Browse files Browse the repository at this point in the history
fix(code-service): null loader for d.ts
  • Loading branch information
Nelfimov authored Aug 21, 2024
2 parents 69ec34f + 69b8d96 commit d25094b
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 900 deletions.
25 changes: 25 additions & 0 deletions .pnp.cjs

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

Binary file not shown.
894 changes: 0 additions & 894 deletions .yarn/releases/yarn-4.2.2.cjs

This file was deleted.

6 changes: 3 additions & 3 deletions .yarn/releases/yarn.cjs

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions .yarn/versions/19c05a3b.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
releases:
"@atls/code-runtime": minor
"@atls/code-service": minor
"@atls/code-service-worker": minor
2 changes: 1 addition & 1 deletion code/code-service-worker/src/service.worker.content.ts

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions code/code-service/src/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { join } from 'node:path'
import { webpack } from '@atls/code-runtime/webpack'
import { tsLoaderPath } from '@atls/code-runtime/webpack'
import { nodeLoaderPath } from '@atls/code-runtime/webpack'
import { nullLoaderPath } from '@atls/code-runtime/webpack'
import tsconfig from '@atls/config-typescript'

import { WebpackExternals } from './webpack.externals.js'
Expand Down Expand Up @@ -78,6 +79,12 @@ export class WebpackConfig {
devtool: environment === 'production' ? 'source-map' : 'eval-cheap-module-source-map',
module: {
rules: [
{
test: /\.d\.ts$/,
use: {
loader: nullLoaderPath,
},
},
{
test: /(^.?|\.[^d]|[^.]d|[^.][^d])\.tsx?$/,
use: {
Expand All @@ -94,6 +101,7 @@ export class WebpackConfig {
},
{ test: /\.(woff|woff2|eot|ttf|otf)$/i, type: 'asset/resource' },
{ test: /\.(png|svg|jpg|jpeg|gif)$/i, type: 'asset/resource' },
{ test: /\.(md)$/i, type: 'asset/resource' },
{ test: /\.node$/, use: nodeLoaderPath },
],
},
Expand Down
1 change: 1 addition & 0 deletions runtime/code-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@svgr/plugin-jsx": "8.1.0",
"eslint": "8.57.0",
"node-loader": "2.0.0",
"null-loader": "4.0.1",
"ts-loader": "9.5.1",
"typescript": "5.4.2",
"webpack": "5.93.0"
Expand Down
3 changes: 2 additions & 1 deletion runtime/code-runtime/src/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ const require = createRequire(import.meta.url)

const tsLoaderPath = require.resolve('ts-loader')
const nodeLoaderPath = require.resolve('node-loader')
const nullLoaderPath = require.resolve('null-loader')

export { webpack, tsLoaderPath, nodeLoaderPath }
export { webpack, tsLoaderPath, nodeLoaderPath, nullLoaderPath }
15 changes: 14 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ __metadata:
"@types/node": "npm:22.4.1"
eslint: "npm:8.57.0"
node-loader: "npm:2.0.0"
null-loader: "npm:4.0.1"
ts-loader: "npm:9.5.1"
typescript: "npm:5.4.2"
webpack: "npm:5.93.0"
Expand Down Expand Up @@ -11644,6 +11645,18 @@ __metadata:
languageName: node
linkType: hard

"null-loader@npm:4.0.1":
version: 4.0.1
resolution: "null-loader@npm:4.0.1"
dependencies:
loader-utils: "npm:^2.0.0"
schema-utils: "npm:^3.0.0"
peerDependencies:
webpack: ^4.0.0 || ^5.0.0
checksum: 10/eeb4c4dd2f8f41e46f5665e4500359109e95ec1028a178a60e0161984906572da7dd87644bcc3cb29f0125d77e2b2508fb4f3813cfb1c6604a15865beb4b987b
languageName: node
linkType: hard

"object-assign@npm:^4.1.1":
version: 4.1.1
resolution: "object-assign@npm:4.1.1"
Expand Down Expand Up @@ -12874,7 +12887,7 @@ pem@dexus/pem:
languageName: node
linkType: hard

"schema-utils@npm:^3.1.1, schema-utils@npm:^3.2.0":
"schema-utils@npm:^3.0.0, schema-utils@npm:^3.1.1, schema-utils@npm:^3.2.0":
version: 3.3.0
resolution: "schema-utils@npm:3.3.0"
dependencies:
Expand Down

0 comments on commit d25094b

Please sign in to comment.