Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": [
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-class-properties",
"babel-plugin-emotion"
"@babel/plugin-proposal-class-properties"
],
"env": {
"esm": {
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
node_modules
yarn.lock
yarn.lock
package-lock.json
dist
lib
es
*.log
.DS_Store
.vscode
9 changes: 9 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Getting Started - Spectacle</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
10 changes: 8 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import React from 'react';
import { render } from 'react-dom';
import MDXDocument from './test.mdx';

import Presentation from './example/src';
/**
* Experiment to test MDX -> JSX transpilation through babel.
*
* Outputs MDXDocument, changing MDXDocument will cause webpack
* to hot-reload with new contents.
*/

render(<Presentation />, document.getElementById('root'));
render(<MDXDocument />, document.getElementById('root'));
23 changes: 19 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"prettier": "prettier \"**/*.{js,json,ts,css,md}\"",
"prettier-fix": "npm run prettier -- --write",
"deploy": "",
"start": "",
"start": "builder run --env \"{\\\"BABEL_ENV\\\":\\\"esm\\\"}\" build-wds-base -- --port=3000 --hot",
"build-wds-base": "webpack-dev-server",
"test": "jest --verbose",
"check": ""
},
Expand All @@ -22,25 +23,39 @@
"type": "git",
"url": "https://github.com/FormidableLabs/spectacle.git"
},
"dependencies": {},
"browserslist": "> 0.25%, not dead",
"peerDependencies": {
"prop-types": "^15.6.2",
"react": "^16.7.0",
"react-dom": "^16.7.0"
},
"devDependencies": {
"@babel/cli": "^7.4.4",
"@babel/core": "^7.4.5",
"@babel/plugin-proposal-class-properties": "^7.4.4",
"@babel/plugin-proposal-object-rest-spread": "^7.4.4",
"@babel/polyfill": "^7.4.4",
"@babel/preset-env": "^7.4.5",
"@babel/preset-react": "^7.0.0",
"@mdx-js/loader": "^1.0.0-rc.4",
"babel-loader": "^8.0.6",
"builder": "^4.0.0",
"eslint": "^4.19.0",
"eslint-config-formidable": "^3.0.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-filenames": "^1.2.0",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-react": "^7.7.0",
"html-webpack-plugin": "^3.2.0",
"prettier": "^1.15.3",
"prop-types": "^15.6.2",
"raw-loader": "^1.0.0",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"tslint": "^5.12.1",
"typescript": "^3.2.2"
"typescript": "^3.2.2",
"webpack": "^4.33.0",
"webpack-cli": "^3.3.4",
"webpack-dev-server": "^3.7.1"
}
}
}
23 changes: 23 additions & 0 deletions test.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!-- This is an MDX file that is imported in index.js and transpiled to
JSX and then rendered, feel free to change this! -->

# Hello, _world_!

Below is an example of JSX embedded in Markdown. <br /> **Kara and dom were successful!**

<div style={{ padding: '20px', backgroundColor: 'aliceblue' }}>
<h3>This is JSX</h3>
</div>

- One ah ah ah
- Two ah ah ah
- Two point five
- Three

## Code snippet test

const hello = "hi";

```js
const hi = 'hello';
```
29 changes: 29 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
entry: './index.js',
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
},
{ test: /\.mdx?$/, use: ['babel-loader', '@mdx-js/loader'] }
]
},
plugins: [
new HtmlWebpackPlugin({
template: `./index.html`
})
]
};