Skip to content

Commit

Permalink
Move to webpack 2. Fixes #6.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-skl committed May 2, 2017
1 parent 0cb5b8a commit 8b24471
Show file tree
Hide file tree
Showing 7 changed files with 4,553 additions and 29 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -17,5 +17,6 @@ script:
- npm run deploy-examples

cache:
yarn: true
directories:
- node_modules
2 changes: 0 additions & 2 deletions karma.conf.js
Expand Up @@ -2,8 +2,6 @@

function getWebpackConfig() {
var config = require('./webpack.config');
//Drop entries because it breaks karma-webpack
config.entry = {};
config.plugins = [];
config.devtool = 'inline-source-map';
return config;
Expand Down
2 changes: 1 addition & 1 deletion lib/websandbox.js
@@ -1,7 +1,7 @@
import uuid from 'an-uuid';
import Connection from './connection';
import defaultFrameContent from './iframe-src.html';
import CompiledFrameScript from 'compile-code?asString=true!./frame.js';
import CompiledFrameScript from 'compile-code-loader?asString=true!./frame.js';
import {Promise} from 'es6-promise-polyfill';

const ID_PREFIX = 'websandbox-';
Expand Down
32 changes: 15 additions & 17 deletions package.json
Expand Up @@ -28,38 +28,36 @@
"author": "Andrey Skladchikov",
"license": "MIT",
"devDependencies": {
"babel-core": "6.21.0",
"babel-eslint": "7.1.1",
"babel-loader": "6.2.10",
"babel-plugin-transform-object-assign": "6.8.0",
"babel-preset-es2015": "6.18.0",
"babel-core": "6.24.1",
"babel-eslint": "7.2.3",
"babel-loader": "7.0.0",
"babel-plugin-transform-object-assign": "6.22.0",
"babel-preset-es2015": "6.24.0",
"chai": "3.5.0",
"electron-prebuilt": "1.4.13",
"electron": "1.6.8",
"es6-promise-polyfill": "1.2.0",
"eslint": "3.13.1",
"eslint": "3.19.0",
"eslint-config-defaults": "9.0.0",
"html-webpack-plugin": "2.26.0",
"karma": "1.3.0",
"html-webpack-plugin": "2.28.0",
"karma": "1.6.0",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "2.0.0",
"karma-electron-launcher": "0.1.0",
"karma-electron-launcher": "0.2.0",
"karma-mocha": "1.3.0",
"karma-sinon": "1.0.5",
"karma-sinon-chai": "1.2.4",
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "2.0.1",
"karma-webpack": "2.0.3",
"mocha": "3.2.0",
"sinon": "1.17.7",
"sinon-chai": "^2.8.0",
"surge": "0.18.0",
"webpack": "1.14.0",
"webpack-config-merger": "0.0.5",
"webpack-dev-server": "1.16.2"
"webpack": "2.4.1",
"webpack-dev-server": "2.4.5"
},
"dependencies": {
"an-uuid": "1.0.2",
"compile-code-loader": "0.0.2",
"file-loader": "0.9.0",
"html-loader": "0.4.4"
"file-loader": "0.11.1",
"html-loader": "0.4.5"
}
}
11 changes: 5 additions & 6 deletions webpack-examples.config.js
@@ -1,11 +1,9 @@
/* eslint-env node */
var HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');

var baseConfig = require('./webpack.config');
delete baseConfig.entry.websandbox;
var configMerger = require('webpack-config-merger');
const baseConfig = require('./webpack.config');

module.exports = configMerger(baseConfig, {
module.exports = {
entry: {
simple: './examples/simple/simple',
style: './examples/style/style',
Expand All @@ -16,6 +14,7 @@ module.exports = configMerger(baseConfig, {
path: __dirname + '/dist-examples',
filename: '[name].js'
},
module: baseConfig.module,
plugins: [
new HtmlWebpackPlugin({
inject: false,
Expand All @@ -37,4 +36,4 @@ module.exports = configMerger(baseConfig, {
template: 'examples/importScript/importScript.html'
})
]
});
};
6 changes: 3 additions & 3 deletions webpack.config.js
Expand Up @@ -12,20 +12,20 @@ module.exports = {
filename: '[name].js'
},
module: {
loaders: [
rules: [
{
test: /\.js$/,
include: [
path.resolve('./', 'examples'),
path.resolve('./', 'lib'),
path.resolve('./', 'test')
],
loader: 'babel-loader'
use: ['babel-loader']
},
{
test: /\.html$/,
include: [path.resolve('./', 'lib')],
loader: 'html?interpolate'
use: ['html-loader?interpolate']
}
]
}
Expand Down

0 comments on commit 8b24471

Please sign in to comment.