hensei-web/node_modules/parcel-bundler/lib/utils/getModuleParts.js
2020-09-11 06:44:42 -07:00

14 lines
No EOL
328 B
JavaScript

"use strict";
const path = require('path');
module.exports = function (name) {
let parts = path.normalize(name).split(path.sep);
if (parts[0].charAt(0) === '@') {
// Scoped module (e.g. @scope/module). Merge the first two parts back together.
parts.splice(0, 2, `${parts[0]}/${parts[1]}`);
}
return parts;
};