From 5c0b0e09212c50b263c0ad20cb5e707922181b6a Mon Sep 17 00:00:00 2001 From: Sylvain Corlay Date: Thu, 23 May 2019 17:21:38 +0200 Subject: [PATCH 1/2] Drop postcss --- packages/html-manager/package.json | 4 ---- packages/html-manager/src/libembed.ts | 2 +- packages/html-manager/webpack.config.js | 25 +------------------------ widgetsnbextension/package.json | 3 --- widgetsnbextension/webpack.config.js | 13 ++----------- 5 files changed, 4 insertions(+), 43 deletions(-) diff --git a/packages/html-manager/package.json b/packages/html-manager/package.json index 434a07182b..f9ed3c0724 100644 --- a/packages/html-manager/package.json +++ b/packages/html-manager/package.json @@ -61,10 +61,6 @@ "karma-mocha": "^1.3.0", "karma-mocha-reporter": "^2.2.3", "mocha": "^3.3.0", - "postcss": "^6.0.2", - "postcss-cssnext": "^3.0.2", - "postcss-import": "^10.0.0", - "postcss-loader": "^2.0.6", "rimraf": "^2.6.1", "style-loader": "^0.18.1", "tslint": "^5.8.0", diff --git a/packages/html-manager/src/libembed.ts b/packages/html-manager/src/libembed.ts index 93b3b40a0f..5a5189f896 100644 --- a/packages/html-manager/src/libembed.ts +++ b/packages/html-manager/src/libembed.ts @@ -6,7 +6,7 @@ __webpack_public_path__ = (window as any).__jupyter_widgets_assets_path__ || __w import 'font-awesome/css/font-awesome.css'; import '@phosphor/widgets/style/index.css'; -import '@jupyter-widgets/controls/css/widgets.built.css'; +import '@jupyter-widgets/controls/css/widgets.css'; // Used just for the typing. We must not import the javascript because we don't // want to include it in the require embedding. diff --git a/packages/html-manager/webpack.config.js b/packages/html-manager/webpack.config.js index cc05b6ab78..c1da781e31 100644 --- a/packages/html-manager/webpack.config.js +++ b/packages/html-manager/webpack.config.js @@ -7,33 +7,10 @@ var path = require('path'); var version = require('./package.json').version; -var postcss = require('postcss'); - var rules = [ { test: /\.css$/, use: [ 'style-loader', - 'css-loader', - { - loader: 'postcss-loader', - options: { - plugins: [ - postcss.plugin('delete-tilde', function() { - return function (css) { - css.walkAtRules('import', function(rule) { - rule.params = rule.params.replace('~', ''); - }); - }; - }), - postcss.plugin('prepend', function() { - return function(css) { - css.prepend("@import '@jupyter-widgets/controls/css/labvariables.css';") - } - }), - require('postcss-import')(), - require('postcss-cssnext')() - ] - } - } + 'css-loader' ]}, // jquery-ui loads some images { test: /\.(jpg|png|gif)$/, use: 'file-loader' }, diff --git a/widgetsnbextension/package.json b/widgetsnbextension/package.json index dc3a7e0188..55106d5b9d 100644 --- a/widgetsnbextension/package.json +++ b/widgetsnbextension/package.json @@ -34,9 +34,6 @@ "devDependencies": { "css-loader": "^0.28.4", "json-loader": "^0.5.4", - "postcss-cssnext": "^3.0.2", - "postcss-import": "^10.0.0", - "postcss-loader": "^2.0.6", "rimraf": "^2.6.1", "style-loader": "^0.18.1", "webpack": "^3.5.5" diff --git a/widgetsnbextension/webpack.config.js b/widgetsnbextension/webpack.config.js index 99e84ab117..92b662c361 100644 --- a/widgetsnbextension/webpack.config.js +++ b/widgetsnbextension/webpack.config.js @@ -11,16 +11,7 @@ module.exports = { rules: [ { test: /\.css$/, use: [ 'style-loader', - 'css-loader', - { - loader: 'postcss-loader', - options: { - plugins: [ - require('postcss-import'), - require('postcss-cssnext') - ] - } - } + 'css-loader' ]}, // jquery-ui loads some images { test: /\.(jpg|png|gif)$/, use: 'file-loader' }, @@ -30,6 +21,6 @@ module.exports = { { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, use: 'url-loader?limit=10000&mimetype=application/octet-stream' }, { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, use: 'file-loader' }, { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, use: 'url-loader?limit=10000&mimetype=image/svg+xml' } - ] + ] }, }; From 15c045c9e00dd3c9e8e7f1d24a4fc0ded79868a8 Mon Sep 17 00:00:00 2001 From: Sylvain Corlay Date: Thu, 23 May 2019 17:46:22 +0200 Subject: [PATCH 2/2] Use widgets.css directly in examples --- examples/web1/index.js | 2 +- examples/web2/index.js | 2 +- packages/controls/css/widgets.css | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/examples/web1/index.js b/examples/web1/index.js index 15160d9ca2..575913bfda 100644 --- a/examples/web1/index.js +++ b/examples/web1/index.js @@ -1,7 +1,7 @@ // Create a widget manager instance. var WidgetManager = require('./manager').WidgetManager; -require('@jupyter-widgets/controls/css/widgets.built.css'); +require('@jupyter-widgets/controls/css/widgets.css'); document.addEventListener("DOMContentLoaded", function(event) { var manager = new WidgetManager(document.body); diff --git a/examples/web2/index.js b/examples/web2/index.js index 430631aaec..8db918e9b2 100644 --- a/examples/web2/index.js +++ b/examples/web2/index.js @@ -3,7 +3,7 @@ require("codemirror/lib/codemirror.css"); require("codemirror/mode/python/python"); var WidgetManager = require("./manager").WidgetManager; -require('@jupyter-widgets/controls/css/widgets.built.css'); +require('@jupyter-widgets/controls/css/widgets.css'); require('font-awesome/css/font-awesome.css'); document.addEventListener("DOMContentLoaded", function(event) { diff --git a/packages/controls/css/widgets.css b/packages/controls/css/widgets.css index 960a88360e..9ab0c3c680 100644 --- a/packages/controls/css/widgets.css +++ b/packages/controls/css/widgets.css @@ -2,9 +2,5 @@ * Distributed under the terms of the Modified BSD License. */ - /* We import all of these together in a single css file because the Webpack -loader sees only one file at a time. This allows postcss to see the variable -definitions when they are used. */ - @import "./labvariables.css"; @import "./widgets-base.css";