1
0
mirror of https://github.com/tabler/tabler.git synced 2026-06-17 12:50:03 +04:00

tmp-dist build dir fix

This commit is contained in:
codecalm
2019-12-21 00:17:40 +01:00
parent 4ffe7cf16c
commit 7917697cfe
5 changed files with 19 additions and 9 deletions
+1
View File
@@ -5,6 +5,7 @@ node_modules/
.jekyll-metadata .jekyll-metadata
.jekyll-cache .jekyll-cache
tmp/ tmp/
tmp-dist/
/yarn.lock /yarn.lock
.DS_Store .DS_Store
/Gemfile.lock /Gemfile.lock
+1 -1
View File
@@ -12,7 +12,7 @@ bs.init({
server: { server: {
routes: { routes: {
'/': 'tmp', '/': 'tmp',
'/dist': 'dist', '/dist': 'tmp-dist',
'/dist/fonts': 'fonts', '/dist/fonts': 'fonts',
'/libs': 'static/libs', '/libs': 'static/libs',
'/img': 'static/img', '/img': 'static/img',
+4 -1
View File
@@ -8,6 +8,7 @@
'use strict'; 'use strict';
const BUNDLE = process.env.BUNDLE === 'true'; const BUNDLE = process.env.BUNDLE === 'true';
const dir = BUNDLE ? 'dist' : 'tmp-dist';
import path from 'path'; import path from 'path';
import babel from 'rollup-plugin-babel'; import babel from 'rollup-plugin-babel';
@@ -34,6 +35,8 @@ if (BUNDLE) {
]); ]);
} }
module.exports = { module.exports = {
context: "window", context: "window",
input: { input: {
@@ -43,7 +46,7 @@ module.exports = {
output: { output: {
banner, banner,
// name: 'tabler', // name: 'tabler',
dir: path.resolve(__dirname, `../dist/js/`), dir: path.resolve(__dirname, `../${dir}/js/`),
entryFileNames: BUNDLE ? '[name].min.js' : '[name].js', entryFileNames: BUNDLE ? '[name].min.js' : '[name].js',
format: 'cjs' format: 'cjs'
}, },
+7 -3
View File
@@ -5,12 +5,16 @@
* Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE) * Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE)
*/ */
const BUNDLE = process.env.BUNDLE === 'true';
const path = require('path'), const path = require('path'),
glob = require("glob"), glob = require("glob"),
fs = require("fs"), fs = require("fs"),
sass = require("node-sass"), sass = require("node-sass"),
packageImporter = require('node-sass-package-importer'); packageImporter = require('node-sass-package-importer');
const dir = BUNDLE ? 'dist' : 'tmp-dist';
glob("scss/tabler*.scss", {}, function (er, files) { glob("scss/tabler*.scss", {}, function (er, files) {
files.forEach(function(file){ files.forEach(function(file){
var basename = path.basename(file, '.scss'); var basename = path.basename(file, '.scss');
@@ -18,7 +22,7 @@ glob("scss/tabler*.scss", {}, function (er, files) {
sass.render( sass.render(
{ {
file: file, file: file,
outFile: `dist/css/${basename}.css`, outFile: `${dir}/css/${basename}.css`,
sourceMap: true, sourceMap: true,
sourceMapContents: true, sourceMapContents: true,
precision: 7, precision: 7,
@@ -26,13 +30,13 @@ glob("scss/tabler*.scss", {}, function (er, files) {
}, },
(error, result) => { (error, result) => {
if (!error) { if (!error) {
fs.writeFile(`dist/css/${basename}.css`, result.css, error => { fs.writeFile(`${dir}/css/${basename}.css`, result.css, error => {
if (error) { if (error) {
console.log(error); console.log(error);
} }
}); });
fs.writeFile(`dist/css/${basename}.css.map`, result.map, error => { fs.writeFile(`${dir}/css/${basename}.css.map`, result.map, error => {
if (error) { if (error) {
console.log(error); console.log(error);
} }
+6 -4
View File
@@ -6,20 +6,22 @@
"scripts": { "scripts": {
"start": "npm-run-all clean css-main js-compile-standalone --parallel browsersync watch", "start": "npm-run-all clean css-main js-compile-standalone --parallel browsersync watch",
"start-incremental": "npm-run-all clean css-main js-compile-standalone --parallel browsersync watch-incremental", "start-incremental": "npm-run-all clean css-main js-compile-standalone --parallel browsersync watch-incremental",
"build": "npm-run-all clean html-build css js assets-copy", "build": "BUNDLE:true npm-run-all clean-build html-build css js assets-copy",
"bundlesize": "bundlesize", "bundlesize": "bundlesize",
"browsersync": "node build/browsersync.js", "browsersync": "node build/browsersync.js",
"assets-copy": "mkdir -p demo/dist && cp -R dist/* demo/dist/ && cp -R static/* demo/", "assets-copy": "mkdir -p demo/dist && cp -R dist/* demo/dist/ && cp -R static/* demo/",
"html-build": "JEKYLL_ENV=production bundle exec jekyll build --destination demo", "html-build": "JEKYLL_ENV=production bundle exec jekyll build --destination demo",
"lint": "npm-run-all --parallel js-lint css-lint", "lint": "npm-run-all --parallel js-lint css-lint",
"clean": "rm -rf dist && mkdir dist && mkdir dist/css && mkdir dist/js", "clean": "rm -rf tmp-dist && mkdir tmp-dist && mkdir tmp-dist/css && mkdir tmp-dist/js",
"clean-build": "rm -rf dist && mkdir dist && mkdir dist/css && mkdir dist/js",
"css": "npm-run-all css-compile css-prefix css-minify", "css": "npm-run-all css-compile css-prefix css-minify",
"css-compile": "node build/scss-compile.js", "css-compile": "node build/scss-compile.js",
"css-prefix": "postcss --config build/postcss.config.js --replace \"dist/css/*.css\" \"!dist/css/*.min.css\"", "css-prefix": "postcss --config build/postcss.config.js --replace \"tmp-dist/css/*.css\" \"!tmp-dist/css/*.min.css\"",
"css-prefix-build": "postcss --config build/postcss.config.js --replace \"dist/css/*.css\" \"!dist/css/*.min.css\"",
"css-minify": "for i in dist/css/tabler*.css;do echo $i; N=`echo $i | sed -e 's/^dist\\/css\\///g' | sed -e 's/\\\\.css//g'`; echo $N; cleancss --level 1 --format breakWith=lf --source-map --source-map-inline-sources --output dist/css/$N.min.css dist/css/$N.css; done", "css-minify": "for i in dist/css/tabler*.css;do echo $i; N=`echo $i | sed -e 's/^dist\\/css\\///g' | sed -e 's/\\\\.css//g'`; echo $N; cleancss --level 1 --format breakWith=lf --source-map --source-map-inline-sources --output dist/css/$N.min.css dist/css/$N.css; done",
"css-lint": "stylelint \"scss/**/*.scss\" --cache --cache-location .cache/.stylelintcache", "css-lint": "stylelint \"scss/**/*.scss\" --cache --cache-location .cache/.stylelintcache",
"css-main": "npm-run-all css-compile css-prefix", "css-main": "npm-run-all css-compile css-prefix",
"css-main-build": "npm-run-all css-lint css-compile css-prefix css-minify", "css-main-build": "npm-run-all css-lint css-compile css-prefix-build css-minify",
"watch": "npm-run-all --parallel watch-css watch-js watch-html", "watch": "npm-run-all --parallel watch-css watch-js watch-html",
"watch-incremental": "npm-run-all --parallel watch-css watch-js watch-html-incremental", "watch-incremental": "npm-run-all --parallel watch-css watch-js watch-html-incremental",
"watch-css": "nodemon --watch scss/ --ext scss --exec \"npm run css-main\"", "watch-css": "nodemon --watch scss/ --ext scss --exec \"npm run css-main\"",