Code Monkey home page Code Monkey logo

154's Introduction

Development server

Run npm start for a dev server. Navigate to http://localhost:8080/. The app will automatically reload if you change any of the source files.

  • Use the npm run start:prod command for a production dev server.

Build

Run npm run build to build the project. The build artifacts will be stored in the public/ directory.

  • Use the npm run build:prod command for a production build.
  • Use the npm run build:sourcemap command for a build with sourcemap.
  • Use the npm run build:prod:sourcemap command for a production build with sourcemap.

Watch

Run npm run watch to watch the project. The build artifacts will be stored in the public/ directory.

  • Use the npm run watch:prod command for a production watch.
  • Use the npm run watch:sourcemap command for a watch with sourcemap.
  • Use the npm run watch:prod:sourcemap command for a production watch with sourcemap.

Linters

Run npm run lint to find problematic patterns or code that doesn’t adhere to certain style guidelines in the project. You can also use npm run lint-fix to fix them.

Code scaffolding

Here's an example how to use


How to configure html tracking

By default, html files are tracking in the src directory.

webpack.config.js

const indexChunk = getHtmlWebpackPlugins( './src', 'html' );
const allHtmlChunk = [ ...indexChunk ];

For example, add tracking of html files in the src/work directory.

webpack.config.js

const indexChunk = getHtmlWebpackPlugins( './src', 'html' );
const workChunk = getHtmlWebpackPlugins( './src/work', 'html' );
const allHtmlChunk = [ ...indexChunk, ...workChunk ];
Metatags description and keywords are in webpack.config.js in the variable DEFAULTS
<meta name="description" content="<%= htmlWebpackPlugin.options.description %>">
<meta name="keywords" content="<%= htmlWebpackPlugin.options.keywords %>">

webpack.config.js

const DEFAULTS = { description: 'description', keywords: 'keywords' };
How to use some library

Use commonJs or ES module

For example, download Swiper npm i swiper and use them in js file.

import Swiper from 'swiper';
const mySwiper = new Swiper('.swiper-container', { /* ... */ });
How to open development server on remote device

Paste YOUR_LOCAL_IP address to host property as string. Navigate to http://YOUR_LOCAL_IP:8080/
Run npm run ip to see your local addresses

webpack.config

/* devServer */
config.devServer = {
 contentBase: path.resolve(__dirname, './src'),
 host: 'YOUR_LOCAL_IP',
 port: 8080,
 stats: 'minimal',
 overlay: true,
 hot: IS_HOST,
 watchContentBase: true,
 open: true,
};

154's People

Contributors

tigranmogrov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.