Commit 202fcbff authored by Guy Bedford's avatar Guy Bedford Committed by Joe Haddad

terser

parent 7194bfc6
/* eslint-disable /* eslint-disable
arrow-body-style arrow-body-style
*/ */
import { minify as terser, MinifyOptions } from 'terser' import { minify as terser, MinifyOptions } from 'next/dist/compiled/terser'
const IS_MODERN_OUTPUT = /\.module\.js$/ const IS_MODERN_OUTPUT = /\.module\.js$/
......
...@@ -87,7 +87,6 @@ ...@@ -87,7 +87,6 @@
"sass-loader": "8.0.2", "sass-loader": "8.0.2",
"style-loader": "1.0.0", "style-loader": "1.0.0",
"styled-jsx": "3.2.5", "styled-jsx": "3.2.5",
"terser": "4.4.2",
"thread-loader": "2.1.3", "thread-loader": "2.1.3",
"unfetch": "4.1.0", "unfetch": "4.1.0",
"url": "0.11.0", "url": "0.11.0",
...@@ -196,6 +195,7 @@ ...@@ -196,6 +195,7 @@
"string-hash": "1.1.3", "string-hash": "1.1.3",
"strip-ansi": "5.2.0", "strip-ansi": "5.2.0",
"taskr": "1.1.0", "taskr": "1.1.0",
"terser": "4.4.2",
"text-table": "0.2.0", "text-table": "0.2.0",
"typescript": "3.7.3", "typescript": "3.7.3",
"unistore": "3.4.1" "unistore": "3.4.1"
......
...@@ -531,6 +531,13 @@ export async function ncc_strip_ansi(task, opts) { ...@@ -531,6 +531,13 @@ export async function ncc_strip_ansi(task, opts) {
.target('dist/compiled/strip-ansi') .target('dist/compiled/strip-ansi')
} }
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
export async function ncc_terser(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('terser')))
.ncc({ packageName: 'terser' })
.target('dist/compiled/terser')
}
// eslint-disable-next-line camelcase
export async function ncc_text_table(task, opts) { export async function ncc_text_table(task, opts) {
await task await task
.source(opts.src || relative(__dirname, require.resolve('text-table'))) .source(opts.src || relative(__dirname, require.resolve('text-table')))
...@@ -603,6 +610,7 @@ export async function precompile(task) { ...@@ -603,6 +610,7 @@ export async function precompile(task) {
'ncc_source_map', 'ncc_source_map',
'ncc_string_hash', 'ncc_string_hash',
'ncc_strip_ansi', 'ncc_strip_ansi',
'ncc_terser',
'ncc_text_table', 'ncc_text_table',
'ncc_unistore', 'ncc_unistore',
]) ])
......
...@@ -176,6 +176,10 @@ declare module 'next/dist/compiled/strip-ansi' { ...@@ -176,6 +176,10 @@ declare module 'next/dist/compiled/strip-ansi' {
import m from 'strip-ansi' import m from 'strip-ansi'
export = m export = m
} }
declare module 'next/dist/compiled/terser' {
import m from 'terser'
export = m
}
declare module 'next/dist/compiled/text-table' { declare module 'next/dist/compiled/text-table' {
function textTable( function textTable(
rows: Array<Array<{}>>, rows: Array<Array<{}>>,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment