Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
155c8153
Unverified
Commit
155c8153
authored
May 19, 2020
by
Tim Neutkens
Committed by
GitHub
May 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove taskr typescript plugin as it's no longer used (#13081)
parent
f66be228
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
65 deletions
+0
-65
taskfile-typescript.js
packages/next/taskfile-typescript.js
+0
-65
No files found.
packages/next/taskfile-typescript.js
deleted
100644 → 0
View file @
f66be228
try
{
const
ts
=
require
(
'typescript'
)
const
extname
=
require
(
'path'
).
extname
// previously next-server/tsconfig.json
const
config
=
{
compilerOptions
:
{
strict
:
true
,
module
:
'esnext'
,
target
:
'ES2017'
,
esModuleInterop
:
true
,
moduleResolution
:
'node'
,
jsx
:
'react'
,
},
exclude
:
[
'./dist/**'
,
'./*.d.ts'
,
'./constants.d.ts'
],
}
module
.
exports
=
function
(
task
)
{
// eslint-disable-next-line require-yield
task
.
plugin
(
'typescript'
,
{
every
:
true
},
function
*
(
file
,
options
)
{
const
opts
=
{
fileName
:
file
.
base
,
compilerOptions
:
{
...
config
.
compilerOptions
,
...
options
,
},
}
const
ext
=
extname
(
file
.
base
)
// Include declaration files as they are
if
(
file
.
base
.
endsWith
(
'.d.ts'
))
return
// For example files without an extension don't have to be rewritten
if
(
ext
)
{
// Replace `.ts` with `.js`
const
extRegex
=
new
RegExp
(
ext
.
replace
(
'.'
,
'
\\
.'
)
+
'$'
,
'i'
)
file
.
base
=
file
.
base
.
replace
(
extRegex
,
'.js'
)
}
// compile output
const
result
=
ts
.
transpileModule
(
file
.
data
.
toString
(),
opts
)
if
(
opts
.
compilerOptions
.
sourceMap
&&
result
.
sourceMapText
)
{
// add sourcemap to `files` array
this
.
_
.
files
.
push
({
dir
:
file
.
dir
,
base
:
`
${
file
.
base
}
.map`
,
data
:
Buffer
.
from
(
JSON
.
stringify
(
result
.
sourceMapText
),
'utf8'
),
})
}
// update file's data
file
.
data
=
Buffer
.
from
(
result
.
outputText
.
replace
(
/process
\.
env
\.
__NEXT_VERSION/g
,
`"
${
require
(
'./package.json'
).
version
}
"`
),
'utf8'
)
})
}
}
catch
(
err
)
{
console
.
error
(
err
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment