malinajs 0.6.49 → 0.7.0-a2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/malina-esbuild.js CHANGED
@@ -11,11 +11,9 @@ process.argv.includes('-w') ? process.env.WATCH = 1 : null;
11
11
 
12
12
  const esbuildConfigPath = path.join(process.cwd(),'esbuild.config.js');
13
13
  const derverConfigPath = path.join(process.cwd(),'derver.config.js');
14
- const malinaConfigPath = path.join(process.cwd(),'malina.config.js');
15
14
 
16
15
  const esbuildConfig = fs.existsSync(esbuildConfigPath) ? require(esbuildConfigPath) : {};
17
16
  const derverConfig = fs.existsSync(derverConfigPath) ? require(derverConfigPath) : {};
18
- const malinaConfig = fs.existsSync(malinaConfigPath) ? require(malinaConfigPath) : {};
19
17
 
20
18
  // Executable
21
19
 
@@ -60,11 +58,6 @@ function malinaPlugin(options={}){
60
58
 
61
59
  const cssModules = new Map();
62
60
 
63
- options = {
64
- ...malinaConfig,
65
- ...options
66
- }
67
-
68
61
  if(options.displayVersion !== false) console.log('! Malina.js', malina.version);
69
62
 
70
63
  return {
@@ -77,13 +70,14 @@ function malinaPlugin(options={}){
77
70
  let source = await fsp.readFile(args.path, 'utf8');
78
71
 
79
72
  let ctx = await malina.compile(source,{
73
+ path: args.path,
80
74
  name: args.path.match(/([^/\\]+)\.\w+$/)[1],
81
75
  ...options
82
76
  });
83
77
 
84
78
  let code = ctx.result;
85
79
 
86
- if(!options.css && ctx.css.result){
80
+ if(ctx.css.result){
87
81
  const cssPath = args.path.replace(/\.\w+$/, ".malina.css").replace(/\\/g, "/");
88
82
  cssModules.set(cssPath,ctx.css.result);
89
83
  code += `\nimport "${cssPath}";`