Skip to content

Commit

Permalink
Merge branch 'prepublish' into tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierfoucrier committed Jul 5, 2020
2 parents 70ef532 + a52e104 commit a132405
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 36 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,6 +1,7 @@
/node_modules
/coverage
/dist
/dev/script.js
.DS_Store
npm-debug.log
.vscode
Expand Down
29 changes: 0 additions & 29 deletions dev/script.js

This file was deleted.

130 changes: 123 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -43,6 +43,7 @@
"coffeeify": "^3.0.1",
"coffeescript": "^1.12.7",
"coveralls": "^3.1.0",
"create-file-webpack": "^1.0.2",
"jasmine": "^3.5.0",
"karma": "^5.1.0",
"karma-babel-preprocessor": "^8.0.1",
Expand Down
38 changes: 38 additions & 0 deletions webpack.dev.js
Expand Up @@ -2,12 +2,50 @@

const path = require('path');
const merge = require('webpack-merge');
const CreateFileWebpack = require('create-file-webpack');

const template = `'use strict';
// get the current mojs version
document.querySelector('.mojs-version').innerHTML += ' ' + mojs.revision;
// build the tween
const burst = new mojs.Burst({
radius: { 1 : 200 },
count: 20,
children: {
radius: 'rand(20, 10)',
delay: 'rand(0, 500)',
duration: 2000,
opacity: 'rand(0.1, 1)'
}
});
// build the timeline and add the tween
const timeline = new mojs.Timeline().add(
burst
);
// build the player and add the timeline
new MojsPlayer({
add: timeline,
isSaveState: true,
isPlaying: true,
isRepeat: true
});`;

module.exports = (argv) => merge(require('./webpack.common.js')(argv), {
mode: 'development',
output: {
filename: 'mo.js'
},
plugins: [
new CreateFileWebpack({
path: './dev/',
fileName: 'script.js',
content: template
})
],
devServer: {
contentBase: [
path.join(__dirname, '/dev'),
Expand Down

0 comments on commit a132405

Please sign in to comment.