issues with rollup.config.js options?
noeldelgado opened this issue · comments
Noel Delgado commented
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:
- Running
npm start
=>tarima -des
ornpm run build
=>tarima -fqe
the output format I get onbuild/bundle.js
iscjs
instead ofiife
(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) onsrc/js/app.js
the output format forbuild/bundle.js
is nowiife
😕. - Also, testing out, if I add the following options to my rollup.config.js
and then run
entry: "src/js/app.js", dest: "build/bundle.js"
./node_modules/.bin/rollup -c
sourceMaps are removed frombuild/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?
Alvaro Cabrera Durán commented
Hi, starting from tarima@4.0.0
the settings changed a bit.
I've updated your settings to match:
- Options
src
,dest
andwatch
has changed tofrom
,output
andwatching
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"