spfx-fast-serve
Advanced tools
Comparing version 1.10.4 to 1.10.5
# Change Log | ||
## [1.10.5] - 24 Apr 2020 | ||
### Fixed | ||
- Bundles loading issue [#4](https://github.com/s-KaiNet/spfx-fast-serve/issues/4) | ||
## [1.10.4] - 29 Mar 2020 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "spfx-fast-serve", | ||
"version": "1.10.4", | ||
"version": "1.10.5", | ||
"author": "Sergei Sergeev (https://github.com/s-KaiNet)", | ||
@@ -5,0 +5,0 @@ "description": "Improve your SharePoint Framework development by speeding up 'serve' command", |
@@ -0,0 +0,0 @@ #!/usr/bin/env node |
const path = require("path"); | ||
const fs = require("fs"); | ||
const webpack = require("webpack"); | ||
@@ -71,3 +72,6 @@ const resolve = require("path").resolve; | ||
options: { | ||
transpileOnly: true | ||
transpileOnly: true, | ||
compilerOptions: { | ||
declarationMap: false | ||
} | ||
}, | ||
@@ -198,17 +202,4 @@ exclude: /node_modules/ | ||
// fix: ".js" entry needs to be ".ts" | ||
// also replaces the path form /lib/* to /src/* | ||
let newEntry = {}; | ||
const pathToSearch = path.sep + "lib" + path.sep; | ||
const pathToReplace = path.sep + "src" + path.sep; | ||
const originalEntries = Object.keys(originalWebpackConfig.entry); | ||
baseConfig.entry = getEntryPoints(originalWebpackConfig.entry); | ||
for (const key in originalWebpackConfig.entry) { | ||
let entry = originalWebpackConfig.entry[key]; | ||
entry = entry.replace(pathToSearch, pathToReplace).slice(0, -3) + ".ts"; | ||
newEntry[key] = entry; | ||
} | ||
baseConfig.entry = newEntry; | ||
baseConfig.output.publicPath = host + "/dist/"; | ||
@@ -218,2 +209,3 @@ | ||
const modulesMap = {}; | ||
const originalEntries = Object.keys(originalWebpackConfig.entry); | ||
@@ -239,2 +231,31 @@ for (const jsModule of manifest) { | ||
function getEntryPoints(entry) { | ||
// fix: ".js" entry needs to be ".ts" | ||
// also replaces the path form /lib/* to /src/* | ||
let newEntry = {}; | ||
let libSearchRegexp; | ||
if (path.sep === "/") { | ||
libSearchRegexp = /\/lib\//gi; | ||
} else { | ||
libSearchRegexp = /\\lib\\/gi; | ||
} | ||
const srcPathToReplace = path.sep + "src" + path.sep; | ||
for (const key in entry) { | ||
let entryPath = entry[key]; | ||
if (entryPath.indexOf("bundle-entries") === -1) { | ||
entryPath = entryPath.replace(libSearchRegexp, srcPathToReplace).slice(0, -3) + ".ts"; | ||
} else { | ||
// replace paths and extensions in bundle file | ||
let bundleContent = fs.readFileSync(entryPath).toString(); | ||
bundleContent = bundleContent.replace(libSearchRegexp, srcPathToReplace).replace(/\.js/gi, ".ts"); | ||
fs.writeFileSync(entryPath, bundleContent); | ||
} | ||
newEntry[key] = entryPath; | ||
} | ||
return newEntry; | ||
} | ||
module.exports = createConfig(); |
const path = require("path"); | ||
const fs = require("fs"); | ||
const webpack = require("webpack"); | ||
@@ -71,3 +72,6 @@ const resolve = require("path").resolve; | ||
options: { | ||
transpileOnly: true | ||
transpileOnly: true, | ||
compilerOptions: { | ||
declarationMap: false | ||
} | ||
}, | ||
@@ -198,17 +202,4 @@ exclude: /node_modules/ | ||
// fix: ".js" entry needs to be ".ts" | ||
// also replaces the path form /lib/* to /src/* | ||
let newEntry = {}; | ||
const pathToSearch = path.sep + "lib" + path.sep; | ||
const pathToReplace = path.sep + "src" + path.sep; | ||
const originalEntries = Object.keys(originalWebpackConfig.entry); | ||
baseConfig.entry = getEntryPoints(originalWebpackConfig.entry); | ||
for (const key in originalWebpackConfig.entry) { | ||
let entry = originalWebpackConfig.entry[key]; | ||
entry = entry.replace(pathToSearch, pathToReplace).slice(0, -3) + ".ts"; | ||
newEntry[key] = entry; | ||
} | ||
baseConfig.entry = newEntry; | ||
baseConfig.output.publicPath = host + "/dist/"; | ||
@@ -218,2 +209,3 @@ | ||
const modulesMap = {}; | ||
const originalEntries = Object.keys(originalWebpackConfig.entry); | ||
@@ -239,2 +231,31 @@ for (const jsModule of manifest) { | ||
function getEntryPoints(entry) { | ||
// fix: ".js" entry needs to be ".ts" | ||
// also replaces the path form /lib/* to /src/* | ||
let newEntry = {}; | ||
let libSearchRegexp; | ||
if (path.sep === "/") { | ||
libSearchRegexp = /\/lib\//gi; | ||
} else { | ||
libSearchRegexp = /\\lib\\/gi; | ||
} | ||
const srcPathToReplace = path.sep + "src" + path.sep; | ||
for (const key in entry) { | ||
let entryPath = entry[key]; | ||
if (entryPath.indexOf("bundle-entries") === -1) { | ||
entryPath = entryPath.replace(libSearchRegexp, srcPathToReplace).slice(0, -3) + ".ts"; | ||
} else { | ||
// replace paths and extensions in bundle file | ||
let bundleContent = fs.readFileSync(entryPath).toString(); | ||
bundleContent = bundleContent.replace(libSearchRegexp, srcPathToReplace).replace(/\.js/gi, ".ts"); | ||
fs.writeFileSync(entryPath, bundleContent); | ||
} | ||
newEntry[key] = entryPath; | ||
} | ||
return newEntry; | ||
} | ||
module.exports = createConfig(); |
const path = require("path"); | ||
const fs = require("fs"); | ||
const webpack = require("webpack"); | ||
@@ -200,17 +201,4 @@ const resolve = require("path").resolve; | ||
// fix: ".js" entry needs to be ".ts" | ||
// also replaces the path form /lib/* to /src/* | ||
let newEntry = {}; | ||
const pathToSearch = path.sep + "lib" + path.sep; | ||
const pathToReplace = path.sep + "src" + path.sep; | ||
const originalEntries = Object.keys(originalWebpackConfig.entry); | ||
baseConfig.entry = getEntryPoints(originalWebpackConfig.entry); | ||
for (const key in originalWebpackConfig.entry) { | ||
let entry = originalWebpackConfig.entry[key]; | ||
entry = entry.replace(pathToSearch, pathToReplace).slice(0, -3) + ".ts"; | ||
newEntry[key] = entry; | ||
} | ||
baseConfig.entry = newEntry; | ||
baseConfig.output.publicPath = host + "/dist/"; | ||
@@ -220,2 +208,3 @@ | ||
const modulesMap = {}; | ||
const originalEntries = Object.keys(originalWebpackConfig.entry); | ||
@@ -241,2 +230,31 @@ for (const jsModule of manifest) { | ||
function getEntryPoints(entry) { | ||
// fix: ".js" entry needs to be ".ts" | ||
// also replaces the path form /lib/* to /src/* | ||
let newEntry = {}; | ||
let libSearchRegexp; | ||
if (path.sep === "/") { | ||
libSearchRegexp = /\/lib\//gi; | ||
} else { | ||
libSearchRegexp = /\\lib\\/gi; | ||
} | ||
const srcPathToReplace = path.sep + "src" + path.sep; | ||
for (const key in entry) { | ||
let entryPath = entry[key]; | ||
if (entryPath.indexOf("bundle-entries") === -1) { | ||
entryPath = entryPath.replace(libSearchRegexp, srcPathToReplace).slice(0, -3) + ".ts"; | ||
} else { | ||
// replace paths and extensions in bundle file | ||
let bundleContent = fs.readFileSync(entryPath).toString(); | ||
bundleContent = bundleContent.replace(libSearchRegexp, srcPathToReplace).replace(/\.js/gi, ".ts"); | ||
fs.writeFileSync(entryPath, bundleContent); | ||
} | ||
newEntry[key] = entryPath; | ||
} | ||
return newEntry; | ||
} | ||
module.exports = createConfig(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
54684
991
0
14