Jump to content

Webpack théme classic


Recommended Posts

Bonjour,

 

J'aimerais modifier le théme classic, seulement j'ai quelques dificultés avec le webpack.
Aprés avoir lancé "npm install", lorsque je lance "npm run watch" cela me sort cette erreur :

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "run" "watch"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] watch: `webpack -w`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] watch script 'webpack
-w'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the prestashop-classic-de
v-tools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack -w
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs prestashop-classic-dev-tools
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls prestashop-classic-dev-tools
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\wamp\www\Site\themes\siteTheme\_dev\npm-debug.log

Voici le contenue du fichier package :

{
    "name": "prestashop-classic-dev-tools",
    "version": "1.0.0",
    "description": "Tools to help while developing the Classic theme",
    "main": "index.js",
    "scripts": {
        "watch": "webpack -w",
        "build": "webpack"
    },
    "author": "PrestaShop",
    "license": "AFL-3.0",
    "devDependencies": {
        "autoprefixer": "^6.7.7",
        "babel-loader": "^5.3.2",
        "bootstrap": "4.0.0-alpha.5",
        "bootstrap-touchspin": "^3.1.1",
        "bourbon": "^4.2.6",
        "css-loader": "^0.27.3",
        "expose-loader": "^0.7.3",
        "extract-text-webpack-plugin": "^2.1.0",
        "file-loader": "^0.10.1",
        "flexibility": "^1.0.5",
        "jquery": "^2.1.4",
        "material-design-icons": "^2.1.3",
        "node-sass": "^4.5.0",
        "notosans-fontface": "~1.0.1",
        "postcss-flexibility": "^1.0.2",
        "postcss-loader": "^1.3.3",
        "sass-loader": "^6.0.3",
        "style-loader": "^0.14.0",
        "tether": "^1.1.1",
        "velocity-animate": "^1.2.3",
        "webpack": "^2.2.1",
        "webpack-sources": "^0.1.0"
    }
}

Et voici le fichier webpack.config :

var webpack = require('webpack');
var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");

var plugins = [];

var production = true;

if (production) {
  plugins.push(
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        warnings: false
      }
    })
  );
}

plugins.push(
  new ExtractTextPlugin(
    path.join(
      '..', 'css', 'theme.css'
    )
  )
);

module.exports = {
  entry: [
    './js/theme.js'
  ],
  output: {
    path: '../assets/js',
    filename: 'theme.js'
  },
  module: {
    loaders: [{
      test: /\.js$/,
      exclude: /node_modules/,
      loaders: ['babel-loader']
    }, {
      test: /\.scss$/,
      loader: ExtractTextPlugin.extract(
        "style",
        "css?sourceMap!postcss!sass?sourceMap"
      )
    }, {
      test: /.(png|woff(2)?|eot|ttf|svg)(\?[a-z0-9=\.]+)?$/,
      loader: 'file-loader?name=../css/[hash].[ext]'
    }, {
      test: /\.css$/,
      loader: "style-loader!css-loader!postcss-loader"
    }]
  },
  postcss: function() {
    return [require('postcss-flexibility')];
  },
  externals: {
    prestashop: 'prestashop',
    $: '$',
    jquery: 'jQuery'
  },
  devtool: 'source-map',
  plugins: plugins,
  resolve: {
    extensions: ['', '.js', '.scss']
  }
};

Ce sont les fichier par défaut.

 

Merci d'avance,

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...