1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-10 18:36:43 +02:00
This commit is contained in:
koalyptus 2018-03-18 12:59:33 +11:00
commit 2da8a56659
6 changed files with 1177 additions and 118 deletions

View file

@ -5,7 +5,7 @@ module.exports = function (grunt) {
var testHost = 'http://localhost:8000/';
var pkg = grunt.file.readJSON('package.json');
var repo = 'github.com/koalyptus/TableFilter';
var styleDirDist = 'dist/tablefilter/style/';
// var styleDirDist = 'dist/tablefilter/style/';
grunt.initConfig({
@ -142,46 +142,49 @@ module.exports = function (grunt) {
},
test: {
command: 'npm run build:test'
},
'build-css': {
command: 'npm run build:css'
}
},
stylus: {
compile: {
options: {
banner: '/** \n' +
' *\t ' + pkg.name + ' v' + pkg.version +
' by ' + pkg.author.name + ' \n' +
' *\t build date: ' + new Date().toISOString() + ' \n' +
' *\t MIT License \n' +
' */ \n'
},
files: [
{
src: ['static/style/*.styl'],
dest: styleDirDist + 'tablefilter.css'
}, {
src: ['static/style/extensions/colsVisibility.styl'],
dest: styleDirDist + 'colsVisibility.css'
}, {
src: ['static/style/extensions/filtersVisibility.styl'],
dest: styleDirDist + 'filtersVisibility.css'
}, {
src: ['static/style/themes/default/*.styl'],
dest: styleDirDist + 'themes/default/default.css'
}, {
src: ['static/style/themes/mytheme/*.styl'],
dest: styleDirDist + 'themes/mytheme/mytheme.css'
}, {
src: ['static/style/themes/skyblue/*.styl'],
dest: styleDirDist + 'themes/skyblue/skyblue.css'
}, {
src: ['static/style/themes/transparent/*.styl'],
dest:
styleDirDist + 'themes/transparent/transparent.css'
}
]
}
},
// stylus: {
// compile: {
// options: {
// banner: '/** \n' +
// ' *\t ' + pkg.name + ' v' + pkg.version +
// ' by ' + pkg.author.name + ' \n' +
// ' *\t build date: ' + new Date().toISOString() + ' \n' +
// ' *\t MIT License \n' +
// ' */ \n'
// },
// files: [
// {
// src: ['static/style/*.styl'],
// dest: styleDirDist + 'tablefilter.css'
// }, {
// src: ['static/style/extensions/colsVisibility.styl'],
// dest: styleDirDist + 'colsVisibility.css'
// }, {
// src: ['static/style/extensions/filtersVisibility.styl'],
// dest: styleDirDist + 'filtersVisibility.css'
// }, {
// src: ['static/style/themes/default/*.styl'],
// dest: styleDirDist + 'themes/default/default.css'
// }, {
// src: ['static/style/themes/mytheme/*.styl'],
// dest: styleDirDist + 'themes/mytheme/mytheme.css'
// }, {
// src: ['static/style/themes/skyblue/*.styl'],
// dest: styleDirDist + 'themes/skyblue/skyblue.css'
// }, {
// src: ['static/style/themes/transparent/*.styl'],
// dest:
// styleDirDist + 'themes/transparent/transparent.css'
// }
// ]
// }
// },
'gh-pages': {
options: {
@ -272,11 +275,11 @@ module.exports = function (grunt) {
// Dev dev/build/watch cycle
grunt.registerTask('dev',
['eslint', 'shell:dev', 'copy:dist', /*'stylus:compile',*/'watch:app']);
['eslint', 'shell:dev', 'copy:dist', 'shell:build-css', 'watch:app']);
// Production build
grunt.registerTask('build',
['eslint', 'shell:build', 'copy:dist'/*, 'stylus:compile'*/]);
['eslint', 'shell:build', 'copy:dist', 'shell:build-css']);
// Build demos
grunt.registerTask('dev-demos', ['build-demos', 'watch:templates']);
@ -285,7 +288,7 @@ module.exports = function (grunt) {
// Build tests
grunt.registerTask('build-test',
['eslint', 'shell:test', 'copy:dist'/*, 'stylus:compile'*/]);
['eslint', 'shell:test', 'copy:dist', 'shell:build-css']);
// Tests with coverage
grunt.registerTask('test', ['build-test', 'connect', 'qunit:all']);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1186
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -25,6 +25,7 @@
"lint": "eslint src/**/*.js test/*.js *.js",
"dev": "webpack --colors --config webpack.dev.config.js",
"build": "webpack --colors --config webpack.config.js",
"build:css": "stylus -c static/style/tablefilter.styl -o dist/tablefilter/style && stylus -c static/style/extensions -o dist/tablefilter/style && stylus -c static/style/themes/default -o dist/tablefilter/style/themes/default && stylus -c static/style/themes/mytheme -o dist/tablefilter/style/themes/mytheme && stylus -c static/style/themes/skyblue -o dist/tablefilter/style/themes/skyblue && stylus -c static/style/themes/transparent -o dist/tablefilter/style/themes/transparent",
"build:demos": "grunt build-demos",
"build:test": "webpack --colors --config webpack.test.config.js",
"server": "webpack-dev-server --colors --hot --config ./webpack.dev.config.js",
@ -46,10 +47,11 @@
"babel-preset-es2015": "^6.24.1",
"clean-webpack-plugin": "^0.1.16",
"codecov": "3.0.0",
"css-loader": "0.28.11",
"diacritics": "1.3.0",
"esdoc": "1.0.4",
"esdoc-standard-plugin": "1.0.0",
"eslint": "4.18.2",
"eslint": "4.19.0",
"extract-text-webpack-plugin": "^3.0.2",
"format-number": "3.0.0",
"grunt": "^1.0.1",
@ -66,6 +68,7 @@
"isparta-loader": "2.0.0",
"script-loader": "^0.7.0",
"string-replace-webpack-plugin": "^0.1.3",
"style-loader": "0.20.3",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"sugar-date": "2.0.4",

View file

@ -2,7 +2,7 @@ const webpack = require('webpack');
const path = require('path');
const Clean = require('clean-webpack-plugin');
const StringReplacePlugin = require('string-replace-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
// const ExtractTextPlugin = require('extract-text-webpack-plugin');
const fs = require('fs');
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
@ -19,7 +19,7 @@ module.exports = {
libraryTarget: 'umd'
},
resolve: {
extensions: ['.js', '.styl'],
extensions: ['.js'],
alias: {
sortabletable: '../../../libs/sortabletable.js'
}
@ -51,7 +51,7 @@ module.exports = {
}
}]
})
}, {
}/*, {
// compile and extract all css definitions from stylus files
test: /\.(styl)$/,
use: ExtractTextPlugin.extract({
@ -66,7 +66,7 @@ module.exports = {
loader: 'stylus-loader'
}]
})
}
}*/
]
},
devtool: 'source-map',
@ -80,6 +80,13 @@ module.exports = {
new webpack.optimize.MinChunkSizePlugin({
minChunkSize: 10000
}),
// extract all styling definitions in a CSS bundle
// with a unique filename
// new ExtractTextPlugin({
// // relative to `output.path`
// filename: './tablefilter.css'/*,
// allChunks: true*/
// }),
new webpack.BannerPlugin({
banner: '/** \n' +
' *\t '+pkg.name+' v'+pkg.version+' by '+pkg.author.name+'\n' +