mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-13 03:25:24 +00:00
fix some typescript stuff
This commit is contained in:
@@ -6,11 +6,24 @@ export default function create_compilers() {
|
||||
|
||||
return {
|
||||
client: webpack(
|
||||
require(path.resolve('webpack.client.config.js'))
|
||||
require(path.resolve('webpack/client.config.js'))
|
||||
),
|
||||
|
||||
server: webpack(
|
||||
require(path.resolve('webpack.server.config.js'))
|
||||
require(path.resolve('webpack/server.config.js'))
|
||||
),
|
||||
|
||||
serviceWorker: webpack(
|
||||
tryRequire(path.resolve('webpack/server.config.js'))
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
function tryRequire(specifier: string) {
|
||||
try {
|
||||
return require(specifier);
|
||||
} catch (err) {
|
||||
if (err.code === 'MODULE_NOT_FOUND') return null;
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user