@@ -98,9 +98,6 @@ module.exports = function(grunt) {
9898 min : {
9999 src : 'dist/css/materialize.min.css'
100100 } ,
101- gh : {
102- src : 'docs/css/ghpages-materialize.css'
103- } ,
104101 bin : {
105102 src : 'bin/materialize.css'
106103 }
@@ -117,9 +114,9 @@ module.exports = function(grunt) {
117114
118115 dev_watch : Object . assign ( { } , webpackConfig , {
119116 mode : 'development' ,
120- watch : true ,
117+ watch : true
121118 } ) ,
122-
119+
123120 dev_dist : Object . assign ( { } , webpackConfig , {
124121 mode : 'development' ,
125122 devtool : false ,
@@ -129,8 +126,8 @@ module.exports = function(grunt) {
129126 output : {
130127 filename : 'materialize.js' ,
131128 path : path . resolve ( __dirname , 'dist/js' ) ,
132- libraryTarget : 'umd' ,
133- globalObject : 'this'
129+ libraryTarget : 'umd' ,
130+ globalObject : 'this'
134131 }
135132 } ) ,
136133
@@ -146,24 +143,7 @@ module.exports = function(grunt) {
146143 libraryTarget : 'umd' ,
147144 globalObject : 'this'
148145 }
149- } ) ,
150- } ,
151-
152- browserSync : {
153- bsFiles : [ 'bin/*' , 'css/ghpages-materialize.css' , '!**/node_modules/**/*' ] ,
154- options : {
155- server : {
156- baseDir : './docs/' // make server from root dir
157- } ,
158- port : 8000 ,
159- ui : {
160- port : 8080 ,
161- weinre : {
162- port : 9090
163- }
164- } ,
165- open : false
166- }
146+ } )
167147 } ,
168148
169149 compress : {
@@ -186,7 +166,7 @@ module.exports = function(grunt) {
186166 files : [
187167 { expand : true , cwd : 'sass/' , src : [ 'materialize.scss' ] , dest : 'materialize-src/sass/' } ,
188168 { expand : true , cwd : 'sass/' , src : [ 'components/**/*' ] , dest : 'materialize-src/sass/' } ,
189- { expand : true , cwd : 'src/' , src : [ '**/*' ] , dest : 'materialize-src/ts/' } ,
169+ { expand : true , cwd : 'src/' , src : [ '**/*' ] , dest : 'materialize-src/ts/' } ,
190170 { expand : true , cwd : 'dist/js/' , src : [ '**/*' ] , dest : 'materialize-src/js/bin/' } ,
191171 { expand : true , cwd : './' , src : [ 'LICENSE' , 'README.md' ] , dest : 'materialize-src/' }
192172 ]
@@ -249,43 +229,7 @@ module.exports = function(grunt) {
249229 }
250230 } ,
251231
252- pug : {
253- compile : {
254- options : {
255- pretty : true ,
256- data : {
257- debug : false
258- }
259- } ,
260- files : [ {
261- expand : true ,
262- cwd : 'pug/' ,
263- src : [ '*.pug' , '!**/pug/includes/*.*' ] ,
264- dest : 'docs/' ,
265- rename : function ( dest , src ) {
266- return dest + src . split ( '.' , 2 ) [ 0 ] + '.html' ;
267- }
268- } ]
269- }
270- } ,
271-
272232 watch : {
273- pug : {
274- files : [ 'pug/**/*' ] ,
275- tasks : [ 'pug_compile' ] ,
276- options : {
277- interrupt : false ,
278- spawn : false
279- }
280- } ,
281- copydocs : {
282- files : [ 'bin/*.js' ] ,
283- tasks : [ 'copy:docs_js' ] ,
284- options : {
285- interrupt : false ,
286- spawn : false
287- }
288- } ,
289233 sass : {
290234 files : [ 'sass/**/*' ] ,
291235 tasks : [ 'sass_compile' ] ,
@@ -302,22 +246,14 @@ module.exports = function(grunt) {
302246 limit : 10
303247 } ,
304248 monitor : {
305- tasks : [
306- 'webpack:dev_watch' ,
307- 'pug_compile' ,
308- 'sass_compile' ,
309- 'watch:pug' ,
310- 'watch:sass' ,
311- 'watch:copydocs' ,
312- 'server'
313- ]
249+ tasks : [ 'webpack:dev_watch' , 'sass_compile' , 'watch:sass' ]
314250 }
315251 } ,
316252
317253 // Replace text to update the version string
318254 replace : {
319255 version : {
320- src : [ 'bower.json' , 'package.js' , 'pug/**/*.html' , 'pug/includes/_navbar.pug' , ' src/global.ts'] ,
256+ src : [ 'bower.json' , 'package.js' , 'src/global.ts' ] ,
321257 overwrite : true ,
322258 replacements : [
323259 {
@@ -335,16 +271,6 @@ module.exports = function(grunt) {
335271 to : '"version": "' + grunt . option ( 'newver' )
336272 }
337273 ]
338- } ,
339- docs : {
340- src : [ '.gitignore' ] ,
341- overwrite : true ,
342- replacements : [
343- {
344- from : '/docs/*.html' ,
345- to : ''
346- }
347- ]
348274 }
349275 } ,
350276
@@ -404,15 +330,6 @@ module.exports = function(grunt) {
404330 }
405331 }
406332 }
407- } ,
408-
409- copy : {
410- docs_js : {
411- files : [ { src : 'bin/materialize.js' , dest : 'docs/js/materialize.js' } ]
412- } ,
413- docs_templates : {
414- files : [ { src : 'templates/**' , dest : 'docs/' } ]
415- }
416333 }
417334 } ;
418335
@@ -422,7 +339,6 @@ module.exports = function(grunt) {
422339 grunt . loadNpmTasks ( 'grunt-contrib-watch' ) ;
423340 grunt . loadNpmTasks ( 'grunt-sass' ) ;
424341 grunt . loadNpmTasks ( 'grunt-contrib-compress' ) ;
425- grunt . loadNpmTasks ( 'grunt-contrib-pug' ) ;
426342 grunt . loadNpmTasks ( 'grunt-concurrent' ) ;
427343 grunt . loadNpmTasks ( 'grunt-text-replace' ) ;
428344 grunt . loadNpmTasks ( 'grunt-banner' ) ;
@@ -432,7 +348,6 @@ module.exports = function(grunt) {
432348 grunt . loadNpmTasks ( 'grunt-postcss' ) ;
433349 grunt . loadNpmTasks ( 'grunt-webpack' ) ;
434350 grunt . loadNpmTasks ( 'grunt-contrib-connect' ) ;
435- grunt . loadNpmTasks ( 'grunt-contrib-copy' ) ;
436351
437352 // define tasks
438353 grunt . registerTask ( 'release' , [
@@ -451,15 +366,14 @@ module.exports = function(grunt) {
451366 'replace:version' , // again because of cdn
452367 'replace:package_json' ,
453368 'rename:rename_src' ,
454- 'rename:rename_compiled' ,
455- ] ) ;
456- grunt . registerTask ( 'pug_compile' , [ 'pug' ] ) ;
457- grunt . registerTask ( 'js_compile' , [ 'webpack:dev' , 'copy:docs_js' ] ) ;
458- grunt . registerTask ( 'sass_compile' , [ 'sass:gh' , 'sass:bin' , 'postcss:gh' , 'postcss:bin' ] ) ;
459- grunt . registerTask ( 'server' , [ 'browserSync' ] ) ;
369+ 'rename:rename_compiled'
370+ ] ) ;
371+
372+ grunt . registerTask ( 'sass_compile' , [ 'sass:gh' , 'sass:bin' , 'postcss:bin' ] ) ;
460373 grunt . registerTask ( 'monitor' , [ 'concurrent:monitor' ] ) ; // DEV
461- grunt . registerTask ( 'test' , [ 'js_compile ' , 'sass_compile' , 'connect' , 'jasmine' ] ) ;
374+ grunt . registerTask ( 'test' , [ 'webpack:dev ' , 'sass_compile' , 'connect' , 'jasmine' ] ) ;
462375 grunt . registerTask ( 'jas_test' , [ 'connect' , 'jasmine' ] ) ;
376+
463377 grunt . registerTask ( 'test_repeat' , function ( ) {
464378 const tasks = [ 'connect' ] ;
465379 const n = 30 ;
@@ -468,13 +382,4 @@ module.exports = function(grunt) {
468382 }
469383 grunt . task . run ( tasks ) ;
470384 } ) ;
471- grunt . registerTask ( 'docs' , [
472- 'js_compile' ,
473- 'copy:docs_js' ,
474- 'copy:docs_templates' ,
475- 'sass:gh' ,
476- 'postcss:gh' ,
477- 'pug' ,
478- 'replace:docs'
479- ] ) ;
480385} ;
0 commit comments