Skip to content

Instantly share code, notes, and snippets.

@rexxars rexxars/index.js
Last active Nov 10, 2017

Embed
What would you like to do?
Webpack test
var React = require('react');
var ReactDOM = require('react-dom');
var ReactMarkdown = require('react-markdown');
var input = '# This is a header\n\nAnd this is a paragraph';
ReactDOM.render(
React.createElement(ReactMarkdown, {source: input}),
document.getElementById('container')
);
{
"name": "wp-test",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"build": "webpack"
},
"dependencies": {
"react": "^16.1.0",
"react-dom": "^16.1.0",
"react-markdown": "^2.5.0",
"uglifyjs-webpack-plugin": "^1.0.1",
"webpack": "^3.8.1"
}
}
var path = require('path')
var webpack = require('webpack')
var UglifyJSPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
entry: path.join(__dirname, 'index.js'),
output: {
filename: 'out.js'
},
plugins: [
new UglifyJSPlugin(),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
})
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.