tacoss / tarima

Templating madness!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

issues with rollup.config.js options?

noeldelgado opened this issue · comments

Versions: tarima@3.7.0 and rollup@0.45.2

I just updated to use tarima for building this small gh-page. I certainly don't need tarima for that, but I was just testing out.

What I found out is:

  1. Running npm start => tarima -des or npm run build => tarima -fqe the output format I get on build/bundle.js is cjs instead of iife (the format I have specified on my rollup.config.js file). But, it gets weirder because after I do a change (or simple click save) on src/js/app.js the output format for build/bundle.js is now iife 😕.
  2. Also, testing out, if I add the following options to my rollup.config.js
    entry: "src/js/app.js",
    dest: "build/bundle.js"
    and then run ./node_modules/.bin/rollup -c sourceMaps are removed from build/bundle.js, which is also strange because I am not specifying to generate sourcemap in the first place, so maybe tarima is adding that option by default?

Hi, starting from tarima@4.0.0 the settings changed a bit.

I've updated your settings to match:

  • Options src, dest and watch has changed to from, output and watching respectively.
  • There was a problem on your watching **.html sources since this glob will match built files too, so matching files from cwd (non-recursively) will do the trick. The right solution is moving any sources within directories, in this case moving your html files within ./src is enough.
  • Bundle globs are better the individual matches, of course this was not an issue.
  • Try to use ignore/ignoreFiles to skip matching all files within sources.
  • Filtering out sources is also a good option to consider. In this case, just ignore all files starting with _ but it can be more complex, ignoring directories too, etc.
  • The new renaming strategy will match only bundled sources.
diff --git a/package.json b/package.json
index c2a5499..23898a3 100644
--- a/package.json
+++ b/package.json
@@ -2,8 +2,8 @@
   "private": true,
   "name": "gemini-scrollbar-gh-page",
   "scripts": {
-    "build": "tarima -fqe",
-    "watch": "tarima -des",
+    "build": "tarima",
+    "watch": "tarima watch",
     "start": "npm run watch"
   },
   "author": "Noel Delgado <auhcsei@gmail.com> (http://pixelia.me/)",
@@ -23,17 +23,20 @@
     "tarima-lr": "^0.3.2"
   },
   "tarima": {
-    "bundle": [
-      "src/js/app.js",
-      "src/less/app.less"
-    ],
+    "bundle": "**/app.*",
     "rollupFile": "rollup.config.js",
-    "public": "./",
-    "src": "./src/**/*",
-    "dest": "./build",
-    "watch": "**.html",
+    "public": ".",
+    "from": "src",
+    "output": "build",
+    "watching": "*.html",
+    "ignore": [
+      ".gitkeep"
+    ],
+    "filter": [
+      "!**/_*"
+    ],
     "rename": [
-      "src/**:bundle.{extname}"
+      "**/app.*:build/bundle.{extname}"
     ],
     "devPlugins": [
       "tarima-lr"