Skip to content

Commit

Permalink
Rollup min- finally working?
Browse files Browse the repository at this point in the history
  • Loading branch information
peteblois committed Feb 10, 2019
1 parent 975e599 commit c13d1cb
Show file tree
Hide file tree
Showing 13 changed files with 105,278 additions and 426 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
dist
.rpt2_cache
lib
node_modules
test
test_lib
.rpt2_cache
yarn.lock
test_lib
98,323 changes: 98,323 additions & 0 deletions dist/dx.dev.js

Large diffs are not rendered by default.

276 changes: 276 additions & 0 deletions dist/dx.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import 'react-table/react-table.css';
import './index.css';
export declare function displayDataExplorer(props: any, parent: HTMLElement): void;
27 changes: 9 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
{
"scripts": {
"build:src:dev": "webpack --config webpack.dev.js",
"build:src:prod": "webpack --config webpack.prod.js",
"build:src:size": "webpack --config webpack.size.js",
"test:build:src": "tsc --project test",
"test:build": "npm run test:clean && npm run test:build:src",
"test:serve": "npm run test:build && node ./test_lib/server.js",
"test:clean": "rimraf test_lib",
"test:server": "npm-run-all test:clean --parallel test:watch:build test:watch:server",
"test:watch:server": "nodemon './test_lib/server.js' --watch './test_lib'",
"rollup:dev": "./node_modules/rollup/bin/rollup -c rollup.dev.js"
"webpack:dev": "webpack --config webpack.dev.js",
"webpack:prod": "webpack --config webpack.prod.js",
"webpack:size": "webpack --config webpack.size.js",
"test:serve": "http-server . --p 9798",
"rollup": "npm run rollup:dev & npm run rollup:min",
"rollup:dev": "rollup -c rollup.dev.js",
"rollup:min": "rollup -c rollup.min.js"
},
"dependencies": {
"@nteract/data-explorer": "^6.0.2",
Expand All @@ -18,25 +15,19 @@
"react-table": "^6.9.0"
},
"devDependencies": {
"@types/node": "^10.12.21",
"@types/optimist": "0.0.29",
"css-loader": "^2.1.0",
"nodemon": "^1.18.9",
"http-server": "^0.11.1",
"npm-run-all": "^4.1.5",
"optimist": "^0.6.1",
"rimraf": "^2.6.1",
"rollup": "^1.1.2",
"rollup-plugin-amd": "^4.0.0",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-embed-css": "^0.4.0",
"rollup-plugin-json": "^3.1.0",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-postcss": "^2.0.3",
"rollup-plugin-replace": "^2.1.0",
"rollup-plugin-typescript": "^1.0.0",
"rollup-plugin-terser": "^4.0.4",
"rollup-plugin-typescript2": "^0.19.2",
"rollup-plugin-uglify-es": "0.0.1",
"source-map-loader": "^0.2.3",
"style-loader": "^0.23.1",
"ts-loader": "^5.3.2",
Expand Down
62 changes: 20 additions & 42 deletions rollup.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import typescript from 'rollup-plugin-typescript2';
import commonjs from 'rollup-plugin-commonjs';
import resolve from 'rollup-plugin-node-resolve';
import json from 'rollup-plugin-json';
import amd from 'rollup-plugin-amd';
import postcss from 'rollup-plugin-postcss';
import embedCSS from 'rollup-plugin-embed-css';
import builtins from 'rollup-plugin-node-builtins';
import replace from 'rollup-plugin-replace';

Expand All @@ -13,89 +11,69 @@ export default {
input: './src/index.ts',
plugins: [
json({
// All JSON files will be parsed by default,
// but you can also specifically include/exclude files
include: 'node_modules/**',

// for tree-shaking, properties will be declared as
// variables, using either `var` or `const`
preferConst: true, // Default: false

// specify indentation for the generated default export —
// defaults to '\t'
indent: ' ',

preferConst: true,
// ignores indent and generates the smallest code
compact: true, // Default: false

// generate a named export for every property of the JSON object
namedExports: true // Default: true
compact: true,
}),
// {
// transform ( code, id ) {
// console.log( id );
// if (id.includes('react-table.css')) {
// console.log(code);
// }
// }
// },
//
postcss({
plugins: []
}),
replace({
// React: default to node.js production environment.
'process.env.NODE_ENV': JSON.stringify('production'),
// @blueprintjs
'process.env.BLUEPRINT_NAMESPACE': JSON.stringify('bp3'),
// uniqid tries to use process if it's available.
'process && process.pid': 'false',
}),
builtins(),
resolve({
jsnext: false,
main: true,
browser: true,
// styled-components' ES6 module doesn't work here-
// specifically appears to be an issue with using both
// default and named exports?
jsnext: false,
module: false,
}),
// embedCSS(),
// amd(),
commonjs({
extensions: ['.js', '.ts'],
include: [ "./index.js", "node_modules/**" ],
namedExports: {
'node_modules/styled-components/index.js': [
'css',
],
'node_modules/react/index.js': [
'Children',
'cloneElement',
'Component',
'PureComponent',
'PropTypes',
'createContext',
'createElement',
'Fragment',
'cloneElement',
'StrictMode',
'createFactory',
'createRef',
'createContext',
'Fragment',
'isValidElement',
'isValidElementType',
'PropTypes',
'PureComponent',
'StrictMode',
],
'node_modules/react-dom/index.js': [
'render',
'hydrate',
'createPortal',
'findDOMNode',
'hydrate',
'render',
'unmountComponentAtNode',
'unstable_renderSubtreeIntoContainer',
'createPortal',
],
'node_modules/react-is/index.js': [
'ForwardRef',
'isElement',
'isValidElementType',
'ForwardRef',
],
},
}),
typescript({
tsconfig: "src/tsconfig.json",
objectHashIgnoreUnknownHack: true,
}),
],
output: {
Expand Down
7 changes: 7 additions & 0 deletions rollup.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import dev from './rollup.dev.js';
import { terser } from "rollup-plugin-terser";

dev.plugins.push(terser());
dev.output.file = 'dist/dx.min.js';

export default dev;
15 changes: 0 additions & 15 deletions test/cert.pem

This file was deleted.

Loading

0 comments on commit c13d1cb

Please sign in to comment.