Navigation Menu

Skip to content

Commit

Permalink
add package for pug, reveal, stylus
Browse files Browse the repository at this point in the history
  • Loading branch information
hirotaka.koga committed Jan 2, 2019
1 parent 5112741 commit 70886dc
Show file tree
Hide file tree
Showing 3 changed files with 1,082 additions and 29 deletions.
5 changes: 5 additions & 0 deletions package.json
Expand Up @@ -26,6 +26,11 @@
"js-cookie": "^2.2.0",
"monaco-editor": "^0.15.6",
"open-iconic": "^1.1.1",
"pug": "^2.0.3",
"pug-loader": "^2.4.0",
"reveal-md": "^2.4.0",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"tui-editor": "^1.2.6",
"vee-validate": "^2.1.3",
"vue-router": "^3.0.1",
Expand Down
80 changes: 78 additions & 2 deletions webpack.mix.js
Expand Up @@ -11,8 +11,84 @@ const mix = require('laravel-mix');
|
*/

//mix.setPublicPath('./');

mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');
.sass('resources/sass/app.scss', 'public/css');

mix.sourceMaps(); // Enable sourcemaps
//mix.babelConfig({ sourceMaps: true }); // Merge extra Babel configuration (plugins, etc.) with Mix's default.
//mix.babelConfig({ sourceMaps: true }); // Merge extra Babel configuration (plugins, etc.) with Mix's default.

if (mix.inProduction()) {
mix.version(); // Enable Versioning
}

// const CopyWebpackPlugin = require('copy-webpack-plugin')
// const WriteFilePlugin = require('write-file-webpack-plugin');

// function copyRevealJsFiles(pattern, outputDirectory = '') {
// return {
// from: `node_modules/reveal.js/${pattern}`,
// to: outputDirectory,
// transformPath(targetPath) {
// return targetPath.replace('node_modules/reveal.js/', '');
// }
// }
// }

// mix.webpackConfig({
// module: {
// rules: [{
// test: require.resolve('reveal.js'),
// use: [{
// loader: 'expose-loader',
// options: 'Reveal'
// }]
// }]
// },
// plugins: [
// new CopyWebpackPlugin([
// copyRevealJsFiles('plugin/notes/*'),
// copyRevealJsFiles('plugin/markdown/*'),
// copyRevealJsFiles('css/reveal.css', 'css'),
// copyRevealJsFiles('css/theme/white.css', 'css/theme'),
// copyRevealJsFiles('lib/font/source-sans-pro/source-sans-pro.css', 'lib/font/source-sans-pro')
// ]),
// new WriteFilePlugin()
// ]
// });

function copyRevealFiles(pattern) {
mix.copy(`node_modules/reveal.js/${pattern}`, `public/${pattern}`).minify(`public/${pattern}`);
}

function copyRevealDirs(pattern) {
mix.copyDirectory(`node_modules/reveal.js/${pattern}`, `public/${pattern}`);
}

copyRevealFiles('js/reveal.js');

copyRevealFiles('css/reveal.css');
copyRevealFiles('css/theme/black.css');
copyRevealFiles('css/print/paper.css');
copyRevealFiles('css/print/pdf.css');

copyRevealFiles('lib/css/zenburn.css');
copyRevealFiles('lib/js/classList.js');
copyRevealFiles('lib/js/head.min.js');

copyRevealDirs('lib/font/source-sans-pro');

copyRevealFiles('plugin/highlight/highlight.js');
copyRevealFiles('plugin/markdown/markdown.js');
copyRevealFiles('plugin/markdown/marked.js');
copyRevealFiles('plugin/math/math.js');
copyRevealFiles('plugin/multiplex/client.js');
copyRevealFiles('plugin/multiplex/index.js');
copyRevealFiles('plugin/multiplex/master.js');
copyRevealFiles('plugin/notes/notes.js');
copyRevealFiles('plugin/notes-server/client.js');
copyRevealFiles('plugin/notes-server/index.js');
copyRevealFiles('plugin/print-pdf/print-pdf.js');
copyRevealFiles('plugin/search/search.js');
copyRevealFiles('plugin/zoom-js/zoom.js');

0 comments on commit 70886dc

Please sign in to comment.