0.5.1 • Published 6 years ago

remixure v0.5.1

Weekly downloads
8
License
MIT
Repository
github
Last release
6 years ago

remixure

remixure is to help to quickly build a webpack based React project. You don't have to familay with the webpack, babel and so on. remixure will help to build your React/ES6/LESS code. All you have to do is to install the remixure and run the build.

Install

Install with npm:

npm i --save-dev remixure

Install with yarn

yarn add remixure --dev

How to use

  1. In your project package.json, add the content:
"scripts": {
  "build": "remixure build --env=prod",
  "dev": "remixure build --env=dev"
}
  1. Create the configuration file in your config folder.
  • config.default.js: The default configuration file can save all the basic configurations.
  • env: The env speicific file. You can also set the env in the CLI. The CLI --env=prod value will overwrite the env file's configuration.
  • config.${env}.js: The configuration file for the target env. It will overwrite the config.default.js.
  1. Do the build:
yarn run dev
# OR
yarn run production

Configurations:

exports.publicPath = '/'; // Optional: The public path for the build. Default is /.

exports.less = {
  // Enable less

  // If enable CSS modules.
  enableCSSModule: true,
  // If use post css:
  enablePostCSS: true,
  // Exclude folder. node_modules is the default folder. Do not need to add it.
  exclude: [/iconfont/],
  options: {
    modifyVars: "green",  // Customize options for less.
  }
}
exports.entry = {
  // This is the entry file configuration.
  // By default entry files will be all jsx/js file under src's root folder.
  // If you want to exclude some file, you need to do as follows:

}

exports.antd = { // If you are using antd.
  theme: 'YOUR THEME HERE', // If you are using ant theme.
};

exports.ignoreUglify = true; // You can ignore the uglify process by setting this to true.

exports.uglifyParallel = true; // (Boolean or Number) If it is true, will parallel uglify by os.cpus.length - 1. If it is false, disable the parallel uglify. If it is a number, will set the cpus cores as the number.

exports.useMoment = true; // If you are using moment.js.

exports.chunks = ['vendor', 'components']; // The chunk key you want to do the chunk.

exports.htmlPath = 'public/index.html'; // If you want to pack index.html with the <script> inject. You need the speicific your index template path.

exports.cleanBeforeBuild = true; // If you want to clean the build folder before job start.

exports.compiledNodeModules = ['YourModuleCode']; // If you want to build some node_module folders using babel loader or less loader. Put it here.

exports.ignoreCSSModule = ['YourCSSModule']; // If you want want any projects like antd ignore CSS module. Put it here.

exports.i18n = {
  "languages": ["en", "zh-CN"],
  "defaultLanguage": "zh-CN",  // This is only used in dev mode.
};  // If you want to use multi-language. We can use the lang-loader for you.

exports.addtionalPlugins = [...]; // Your plugin in here.

exports.enableDva = true; // If you want to dva.

If you want to use the dev mode. There are some addional configurations under config/config.dev.js:

// This can be put in config.dev.js so that the production will not excuted.
exports.devServer = {
  "HTTPS": "https", // Optional: Default value is http.
  "HOST": "0.0.0.0", // Optional: Default value is 0.0.0.0.
  "PORT": "8888", // Optional: Default value is 8888.
}; // If you want to enable the devServer.

exports.inspection = "http://localhost:8080" // Auto open and refresh browser only support macOS.

exports.i18n.defaultLanguage = 'zh-CN'; // For dev mode, we can only compile one language for one time. So we need to speicific the default language.

exports.enableSourceMap = true; // Make the source map avaiable even dev is false.

exports.ignoreNameHash = true; // This will not hash your output file name even in production mode.

exports.browsers: = [
  '>1%',
  'last 4 versions',
  'Firefox ESR',
  'not ie < 9'
]; // You can sepecific target browsers you need.

Read language configuration from JS code

In your HTML template, put the code like this:

<script>
  var language = '%language%';
</script>

Then you can use this in your code now.

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.1

6 years ago

1.0.0-beta12

6 years ago

1.0.0-beta11

6 years ago

1.0.0-beta10

6 years ago

1.0.0-beta9

6 years ago

1.0.0-beta8

6 years ago

1.0.0-beta7

6 years ago

1.0.0-beta6

6 years ago

1.0.0-beta5

6 years ago

1.0.0-beta4

6 years ago

1.0.0-beta3

6 years ago

1.0.0-beta2

6 years ago

1.0.0-beta1

6 years ago

0.5.1

6 years ago

1.0.0

6 years ago

1.0.0-beta.3

6 years ago

1.0.0-beta.2

6 years ago

1.0.0-beta.1

6 years ago

1.0.0-beta.0

6 years ago

1.0.0-beta

6 years ago

0.5.0

6 years ago

0.3.9

6 years ago

0.4.3

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.8

6 years ago

0.3.7

6 years ago

0.3.6

6 years ago

0.3.5

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.0.40-1

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.51

7 years ago

0.0.50

7 years ago

0.0.47

7 years ago

0.0.46

7 years ago

0.0.45

7 years ago

0.0.44

7 years ago

0.0.43

7 years ago

0.0.42

7 years ago

0.0.41

7 years ago

0.0.40

7 years ago

0.0.39

7 years ago

0.0.38

7 years ago

0.0.37

7 years ago

0.0.36

7 years ago

0.0.35

7 years ago

0.0.34

7 years ago

0.0.33

7 years ago

0.0.32

7 years ago

0.0.31

7 years ago

0.0.29

7 years ago

0.0.28

7 years ago

0.0.27

7 years ago

0.0.26

7 years ago

0.0.24

7 years ago

0.0.23

7 years ago

0.0.22

7 years ago

0.0.20

7 years ago

0.0.19

7 years ago

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.55555

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago