From 5e0bae8aecd0f5b7307e9fedc8de6b4644fff19a Mon Sep 17 00:00:00 2001 From: Herb Miller Date: Wed, 28 Nov 2018 11:35:30 +0000 Subject: [PATCH] Issue #21 - remove the configuration files used to build JavaScript --- .babelrc | 25 -------------- .gitignore | 3 -- package.json | 38 --------------------- webpack.config.js | 85 ----------------------------------------------- 4 files changed, 151 deletions(-) delete mode 100644 .babelrc delete mode 100644 package.json delete mode 100644 webpack.config.js diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 2df218d..0000000 --- a/.babelrc +++ /dev/null @@ -1,25 +0,0 @@ -{ - "presets": [ - [ - "env", - { - "modules": false - } - ] - ], - "plugins": [ - "transform-object-rest-spread", - [ - "transform-react-jsx", - { - "pragma": "wp.element.createElement" - } - ], - ["lodash"] - ], - "env": { - "default": { - "plugins": ["transform-runtime"] - } - } -} diff --git a/.gitignore b/.gitignore index 849ab33..2fd7ec7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,2 @@ -node_modules -node_modules-renamed -package-lock.json .idea/ .~lock* diff --git a/package.json b/package.json deleted file mode 100644 index 5a41505..0000000 --- a/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "oik-block", - "scripts": { - "dev": "cross-env BABEL_ENV=default webpack --watch", - "build": "cross-env BABEL_ENV=default NODE_ENV=production webpack" - }, - "main": "blocks/index.js", - "devDependencies": { - "babel-core": "^6.26.3", - "babel-eslint": "^8.1.2", - "babel-loader": "^7.1.1", - "babel-plugin-transform-object-rest-spread": "^6.26.0", - "babel-plugin-transform-react-jsx": "^6.24.1", - "babel-plugin-transform-runtime": "^6.23.0", - "babel-preset-env": "^1.7.0", - "browser-sync": "^2.26.3", - "browser-sync-webpack-plugin": "^1.2.0", - "classnames": "^2.2.5", - "cross-env": "^5.1.1", - "css-loader": "^0.28.7", - "eslint": "^4.14.0", - "eslint-config-prettier": "^2.9.0", - "eslint-config-wordpress": "^2.0.0", - "eslint-plugin-prettier": "^2.4.0", - "extract-text-webpack-plugin": "^3.0.2", - "node-sass": "^4.9.4", - "postcss-loader": "^2.0.9", - "raw-loader": "^0.5.1", - "sass-loader": "^6.0.6", - "style-loader": "^0.19.1", - "webpack": "^3.10.0" - }, - "version": "0.0.0", - "license": "MIT", - "dependencies": { - "babel-plugin-lodash": "^3.3.4" - } -} diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index 394c40c..0000000 --- a/webpack.config.js +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Controls the oik-block build - * - * All of the blocks are built into the one package. - * All the frontend CSS is built into one file. - * The Editor CSS is built into another. - * - * @copyright (C) Copyright Bobbing Wide 2018 - * @author Herb Miller @bobbingwide - */ -const path = require( 'path' ); -const webpack = require( 'webpack' ); -const ExtractTextPlugin = require( 'extract-text-webpack-plugin' ); -// const BrowserSyncPlugin = require( 'browser-sync-webpack-plugin' ); - -// Set different CSS extraction for editor only and common block styles -const blocksCSSPlugin = new ExtractTextPlugin( { - filename: './blocks/build/css/blocks.style.css', -} ); -const editBlocksCSSPlugin = new ExtractTextPlugin( { - filename: './blocks/build/css/blocks.editor.css', -} ); - -// Configuration for the ExtractTextPlugin. -const extractConfig = { - use: [ - { loader: 'raw-loader' }, - { - loader: 'postcss-loader', - options: { - plugins: [ require( 'autoprefixer' ) ], - }, - }, - { - loader: 'sass-loader', - query: { - outputStyle: - 'production' === process.env.NODE_ENV ? 'compressed' : 'nested', - }, - }, - ], -}; - -module.exports = { - entry: { - './blocks/build/js/editor.blocks' : './blocks/index.js', - //'./blocks/build/js/frontend.blocks' : './blocks/frontend.js', - }, - output: { - path: path.resolve( __dirname ), - filename: '[name].js', - }, - watch: false, - devtool: 'cheap-eval-source-map', - module: { - rules: [ - { - test: /\.js$/, - exclude: /(node_modules|bower_components)/, - use: { - loader: 'babel-loader', - }, - }, - { - test: /style\.s?css$/, - use: blocksCSSPlugin.extract( extractConfig ), - }, - { - test: /editor\.s?css$/, - use: editBlocksCSSPlugin.extract( extractConfig ), - }, - ], - }, - plugins: [ - blocksCSSPlugin, - editBlocksCSSPlugin, - // new BrowserSyncPlugin({ - // // Load localhost:3333 to view proxied site - // host: 'localhost', - // port: '3333', - // // Change proxy to your local WordPress URL - // proxy: 'https://gutenberg.local' - // }) - ], -};