diff options
-rw-r--r-- | web-ui/app/index.html | 4 | ||||
-rw-r--r-- | web-ui/app/sandbox.html | 4 | ||||
-rw-r--r-- | web-ui/config/copy-webpack.js | 86 | ||||
-rw-r--r-- | web-ui/config/package.sh | 9 | ||||
-rw-r--r-- | web-ui/package.json | 3 | ||||
-rw-r--r-- | web-ui/webpack.config.js | 81 | ||||
-rw-r--r-- | web-ui/webpack.production.config.js | 79 |
7 files changed, 91 insertions, 175 deletions
diff --git a/web-ui/app/index.html b/web-ui/app/index.html index 4cdcb248..b40aecdf 100644 --- a/web-ui/app/index.html +++ b/web-ui/app/index.html @@ -92,7 +92,6 @@ </div> </div> -<!--usemin_start--> <script src="assets/bower_components/modernizr/modernizr.js"></script> <script src="assets/bower_components/lodash/dist/lodash.min.js"></script> <script src="assets/bower_components/jquery/dist/jquery.min.js"></script> @@ -105,8 +104,7 @@ <script src="assets/bower_components/foundation/js/foundation/foundation.reveal.js" ></script> <script src="assets/bower_components/foundation/js/foundation/foundation.offcanvas.js"></script> <script src="assets/js/foundation/initialize_foundation.js"></script> -<script src="assets/app.min.js"></script> -<!--usemin_end--> +<script src="assets/app.js"></script> </body> </html> diff --git a/web-ui/app/sandbox.html b/web-ui/app/sandbox.html index 8325b0da..3e110977 100644 --- a/web-ui/app/sandbox.html +++ b/web-ui/app/sandbox.html @@ -5,10 +5,8 @@ <meta charset="utf-8"> <link href="css/sandbox.css" rel="stylesheet" type="text/css"> - <!--usemin_start--> - <script src="js/sandbox.js"></script> + <script src="sandbox.js"></script> <script src="bower_components/iframe-resizer/js/iframeResizer.contentWindow.min.js"></script> - <!--usemin_end--> </head> <body></body> diff --git a/web-ui/config/copy-webpack.js b/web-ui/config/copy-webpack.js new file mode 100644 index 00000000..79a5de83 --- /dev/null +++ b/web-ui/config/copy-webpack.js @@ -0,0 +1,86 @@ +var CopyWebpackPlugin = require('copy-webpack-plugin'); + +module.exports = new CopyWebpackPlugin([ + { context: 'app/', from: '404.html' }, + { context: 'app/', from: 'index.html' }, + { context: 'app/', from: 'sandbox.html' }, + { context: 'app/', from: 'css/*' }, + { context: 'app/', from: 'fonts/*' }, + { context: 'app/', from: 'locales/**/*' }, + { context: 'app/', from: 'bower_components/font-awesome/fonts/*' }, + { + context: 'app/', + from: 'bower_components/font-awesome/css/font-awesome.min.css', + to: 'bower_components/font-awesome/css' + }, + { + context: 'app/', + from: 'bower_components/jquery-file-upload/css/jquery.fileupload.css', + to: 'bower_components/jquery-file-upload/css' + }, + { + context: 'app/', + from: 'bower_components/modernizr/modernizr.js', + to: 'bower_components/modernizr' + }, + { + context: 'app/', + from: 'bower_components/lodash/dist/lodash.min.js', + to: 'bower_components/lodash/dist' + }, + { + context: 'app/', + from: 'bower_components/jquery/dist/jquery.min.js', + to: 'bower_components/jquery/dist' + }, + { + context: 'app/', + from: 'bower_components/jquery-ui/jquery-ui.min.js', + to: 'bower_components/jquery-ui' + }, + { + context: 'app/', + from: 'bower_components/jquery-file-upload/js/jquery.fileupload.js', + to: 'bower_components/jquery-file-upload/js' + }, + { + context: 'app/', + from: 'bower_components/handlebars/handlebars.min.js', + to: 'bower_components/handlebars' + }, + { + context: 'app/', + from: 'bower_components/typeahead.js/dist/typeahead.bundle.min.js', + to: 'bower_components/typeahead.js/dist' + }, + { + context: 'app/', + from: 'bower_components/iframe-resizer/js/iframeResizer.min.js', + to: 'bower_components/iframe-resizer/js' + }, + { + context: 'app/', + from: 'bower_components/iframe-resizer/js/iframeResizer.contentWindow.min.js', + to: 'bower_components/iframe-resizer/js' + }, + { + context: 'app/', + from: 'bower_components/foundation/js/foundation.js', + to: 'bower_components/foundation/js' + }, + { + context: 'app/', + from: 'bower_components/foundation/js/foundation/foundation.reveal.js', + to: 'bower_components/foundation/js/foundation' + }, + { + context: 'app/', + from: 'bower_components/foundation/js/foundation/foundation.offcanvas.js', + to: 'bower_components/foundation/js/foundation' + }, + { + context: 'app/', + from: 'js/foundation/initialize_foundation.js', + to: 'js/foundation' + } +]) diff --git a/web-ui/config/package.sh b/web-ui/config/package.sh index cfb66879..97cf185a 100644 --- a/web-ui/config/package.sh +++ b/web-ui/config/package.sh @@ -25,12 +25,3 @@ mkdir -p dist # initial npm tasks ./go build-prod ./go imagemin -./go minify_sandbox - - -# concat js files and minify for sandbox.min.js -cat \ -app/js/sandbox.js \ -app/bower_components/iframe-resizer/js/iframeResizer.contentWindow.js > dist/sandbox.js -node_modules/.bin/minify dist/sandbox.js > dist/sandbox.min.js -rm dist/sandbox.js diff --git a/web-ui/package.json b/web-ui/package.json index de80bded..0d64a5df 100644 --- a/web-ui/package.json +++ b/web-ui/package.json @@ -59,10 +59,9 @@ "build-prod": "npm run build-statics && webpack -p --config ./webpack.production.config.js", "build-js": "webpack --colors --progress", "jshint": "jshint --config=.jshintrc app test", - "clean": "rm -rf 'dist/*' app/js/generated/hbs/* app/css/*", + "clean": "rm -rf dist/ app/js/generated/hbs/* app/css/*", "package": "/bin/bash config/package.sh", "imagemin": "node config/imagemin.js", - "minify_sandbox": "html-minifier app/sandbox.html --collapse-whitespace | sed 's|<!--usemin_start-->.*<!--usemin_end-->|<script src=\"sandbox.min.js\" type=\"text/javascript\"></script>|' > dist/sandbox.html", "add_git_version": "/bin/bash config/add_git_version.sh" } } diff --git a/web-ui/webpack.config.js b/web-ui/webpack.config.js index ca795ea5..794ce08d 100644 --- a/web-ui/webpack.config.js +++ b/web-ui/webpack.config.js @@ -49,84 +49,5 @@ module.exports = { } ] }, - plugins: [ - new CopyWebpackPlugin([ - { context: 'app/', from: '404.html' }, - { context: 'app/', from: 'index.html' }, - { context: 'app/', from: 'css/*' }, - { context: 'app/', from: 'fonts/*' }, - { context: 'app/', from: 'locales/**/*' }, - { context: 'app/', from: 'bower_components/font-awesome/fonts/*' }, - { - context: 'app/', - from: 'bower_components/font-awesome/css/font-awesome.min.css', - to: 'bower_components/font-awesome/css' - }, - { - context: 'app/', - from: 'bower_components/jquery-file-upload/css/jquery.fileupload.css', - to: 'bower_components/jquery-file-upload/css' - }, - { - context: 'app/', - from: 'bower_components/modernizr/modernizr.js', - to: 'bower_components/modernizr' - }, - { - context: 'app/', - from: 'bower_components/lodash/dist/lodash.min.js', - to: 'bower_components/lodash/dist' - }, - { - context: 'app/', - from: 'bower_components/jquery/dist/jquery.min.js', - to: 'bower_components/jquery/dist' - }, - { - context: 'app/', - from: 'bower_components/jquery-ui/jquery-ui.min.js', - to: 'bower_components/jquery-ui' - }, - { - context: 'app/', - from: 'bower_components/jquery-file-upload/js/jquery.fileupload.js', - to: 'bower_components/jquery-file-upload/js' - }, - { - context: 'app/', - from: 'bower_components/handlebars/handlebars.min.js', - to: 'bower_components/handlebars' - }, - { - context: 'app/', - from: 'bower_components/typeahead.js/dist/typeahead.bundle.min.js', - to: 'bower_components/typeahead.js/dist' - }, - { - context: 'app/', - from: 'bower_components/iframe-resizer/js/iframeResizer.min.js', - to: 'bower_components/iframe-resizer/js' - }, - { - context: 'app/', - from: 'bower_components/foundation/js/foundation.js', - to: 'bower_components/foundation/js' - }, - { - context: 'app/', - from: 'bower_components/foundation/js/foundation/foundation.reveal.js', - to: 'bower_components/foundation/js/foundation' - }, - { - context: 'app/', - from: 'bower_components/foundation/js/foundation/foundation.offcanvas.js', - to: 'bower_components/foundation/js/foundation' - }, - { - context: 'app/', - from: 'js/foundation/initialize_foundation.js', - to: 'js/foundation' - } - ]) - ] + plugins: [copyWebpack] } diff --git a/web-ui/webpack.production.config.js b/web-ui/webpack.production.config.js index 77ff1fb9..78cfe843 100644 --- a/web-ui/webpack.production.config.js +++ b/web-ui/webpack.production.config.js @@ -50,83 +50,6 @@ module.exports = { plugins: [ new webpack.optimize.UglifyJsPlugin(), new webpack.optimize.DedupePlugin(), - new CopyWebpackPlugin([ - { context: 'app/', from: '404.html' }, - { context: 'app/', from: 'index.html' }, - { context: 'app/', from: 'css/*' }, - { context: 'app/', from: 'fonts/*' }, - { context: 'app/', from: 'locales/**/*' }, - { context: 'app/', from: 'bower_components/font-awesome/fonts/*' }, - { - context: 'app/', - from: 'bower_components/font-awesome/css/font-awesome.min.css', - to: 'bower_components/font-awesome/css' - }, - { - context: 'app/', - from: 'bower_components/jquery-file-upload/css/jquery.fileupload.css', - to: 'bower_components/jquery-file-upload/css' - }, - { - context: 'app/', - from: 'bower_components/modernizr/modernizr.js', - to: 'bower_components/modernizr' - }, - { - context: 'app/', - from: 'bower_components/lodash/dist/lodash.min.js', - to: 'bower_components/lodash/dist' - }, - { - context: 'app/', - from: 'bower_components/jquery/dist/jquery.min.js', - to: 'bower_components/jquery/dist' - }, - { - context: 'app/', - from: 'bower_components/jquery-ui/jquery-ui.min.js', - to: 'bower_components/jquery-ui' - }, - { - context: 'app/', - from: 'bower_components/jquery-file-upload/js/jquery.fileupload.js', - to: 'bower_components/jquery-file-upload/js' - }, - { - context: 'app/', - from: 'bower_components/handlebars/handlebars.min.js', - to: 'bower_components/handlebars' - }, - { - context: 'app/', - from: 'bower_components/typeahead.js/dist/typeahead.bundle.min.js', - to: 'bower_components/typeahead.js/dist' - }, - { - context: 'app/', - from: 'bower_components/iframe-resizer/js/iframeResizer.min.js', - to: 'bower_components/iframe-resizer/js' - }, - { - context: 'app/', - from: 'bower_components/foundation/js/foundation.js', - to: 'bower_components/foundation/js' - }, - { - context: 'app/', - from: 'bower_components/foundation/js/foundation/foundation.reveal.js', - to: 'bower_components/foundation/js/foundation' - }, - { - context: 'app/', - from: 'bower_components/foundation/js/foundation/foundation.offcanvas.js', - to: 'bower_components/foundation/js/foundation' - }, - { - context: 'app/', - from: 'js/foundation/initialize_foundation.js', - to: 'js/foundation' - } - ]) + copyWebpack ] } |