Skip to content

Instantly share code, notes, and snippets.

View enkot's full-sized avatar
👌
Focusing

Taras Batenkov enkot

👌
Focusing
View GitHub Profile
@enkot
enkot / transforms.js
Last active February 28, 2016 22:31
Check JavaScript 2D/3D transforms support (not only)
function transformsSupport (value) {
var vendors = [null,'webkit','Moz','O','ms'];
var element = document.createElement('div');
var featureSupport = false;
switch (value) {
case '2D':
featureSupport = propertySupport('Transform');
break;
case '3D':
<div className="sidebar"></div>
<html>
<head>
<title>Getting Started</title>
<script src="https://unpkg.com/lodash@4.16.6"></script>
</head>
<body>
<script src="./src/index.js"></script>
</body>
</html>
var path = require('path');
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
}
};
import upper from './upper';
const app = document.getElementById('app');
app.innerHTML = 'Hello ' + upper('webpack');
function upper(name) {
return name.toUpperCase();
}
export default upper;
<html>
<head>
<title>Our app</title>
</head>
<body>
<div id="app"></div>
<script src="bundle.js"></script>
</body>
</html>
{
"name": "myproject",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "webpack"
},
"license": "MIT",
"devDependencies": {
"webpack": "^3.4.0"
{
"presets": ["es2015", "react"]
}
const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
rules: [