message: fix: normalize import ids for demo.{css,html} files
diff: @@ -25,21 +25,22 @@ module.exports = async function webpackEntry() {
  const reg = await Promise.all(files.map(async file => {
  const full = path.join(options.cwd, file);
  - const rel = path.relative(process.cwd(), full).split(path.sep).join('/');
  + const rawRel = toUnix(path.relative(process.cwd(), full));
  const exported = await getExported(full, { fs: this.fs });
  + const rel = rawRel.charAt(0) === '.' ? rawRel : `./${rawRel}`;
  - const mod = [`module.exports['${file}'] = require('./${rel}');`]
  + const mod = [`module.exports['${file}'] = require('${rel}');`]
  if (exported.indexOf("js") === -1) {
  - mod.push(`module.exports['${file}'].js = function() { return require('./${rawLoader}!./${rel}'); };`);
  + mod.push(`module.exports['${file}'].js = function() { return require('./${rawLoader}!${rel}'); };`);
  }
  if (exported.indexOf("css") === -1 && await exists(ext('.css', full))) {
  - mod.push(`module.exports['${file}'].css = function() { return require('./${ext('.css', rel)}'); };`);
  + mod.push(`module.exports['${file}'].css = function() { return require('${ext('.css', rel)}'); };`);
  }
  if (exported.indexOf("html") === -1 && await exists(ext('.html', full))) {
  - mod.push(`module.exports['${file}'].html = function() { return require('./${ext('.html', rel)}'); };`);
  + mod.push(`module.exports['${file}'].html = function() { return require('${ext('.html', rel)}'); };`);
  }
  return mod.join('\n');
  @@ -58,11 +59,15 @@ function getFiles(options) {
  return globby(entries, { cwd });
  }
  +function toUnix(input) {
  + return input.split(path.sep).join('/');
  +}
  +
  function ext(e, ...input) {
  - const parsed = path.parse(path.join(...input));
  - parsed.base = `${path.basename(parsed.base, path.extname(parsed.base))}${e}`;
  + const parsed = path.posix.parse(path.join(...input));
  + parsed.base = `${path.posix.basename(parsed.base, path.posix.extname(parsed.base))}${e}`;
  parsed.ext = e;
  - return path.format(parsed);
  + return toUnix(path.posix.format(parsed));
  }
  async function getExported(modulePath, { fs }) {
  